Skip to content

Commit 35acaad

Browse files
committed
add env file for db ip, pw, and new relics key
1 parent 36e3a99 commit 35acaad

File tree

5 files changed

+84
-3
lines changed

5 files changed

+84
-3
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
node_modules
22
photos
33
/database/datasets/
4-
newrelic.js
5-
newrelic_agent.log
4+
newrelic_agent.log
5+
.env

database/index.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
const { Database } = require('arangojs');
2+
require('dotenv').config();
23

34
// create handle
4-
const db = new Database();
5+
const db = new Database({
6+
url: `http://${process.env.DB_IP}:8529`,
7+
database: "listingInfo",
8+
auth: { username: "root", password: `${process.env.DB_PW}`}
9+
});
510

611
module.exports = db;

newrelic.js

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
require('dotenv').config();
2+
'use strict'
3+
/**
4+
* New Relic agent configuration.
5+
*
6+
* See lib/config/default.js in the agent distribution for a more complete
7+
* description of configuration variables and their potential values.
8+
*/
9+
exports.config = {
10+
/**
11+
* Array of application names.
12+
*/
13+
app_name: ['SDC-ListingInfo'],
14+
/**
15+
* Your New Relic license key.
16+
*/
17+
license_key: `${process.env.NEW_RELIC_KEY}`,
18+
/**
19+
* This setting controls distributed tracing.
20+
* Distributed tracing lets you see the path that a request takes through your
21+
* distributed system. Enabling distributed tracing changes the behavior of some
22+
* New Relic features, so carefully consult the transition guide before you enable
23+
* this feature: https://docs.newrelic.com/docs/transition-guide-distributed-tracing
24+
* Default is true.
25+
*/
26+
distributed_tracing: {
27+
/**
28+
* Enables/disables distributed tracing.
29+
*
30+
* @env NEW_RELIC_DISTRIBUTED_TRACING_ENABLED
31+
*/
32+
enabled: true
33+
},
34+
logging: {
35+
/**
36+
* Level at which to log. 'trace' is most useful to New Relic when diagnosing
37+
* issues with the agent, 'info' and higher will impose the least overhead on
38+
* production applications.
39+
*/
40+
level: 'info'
41+
},
42+
/**
43+
* When true, all request headers except for those listed in attributes.exclude
44+
* will be captured for all traces, unless otherwise specified in a destination's
45+
* attributes include/exclude lists.
46+
*/
47+
allow_all_headers: true,
48+
attributes: {
49+
/**
50+
* Prefix of attributes to exclude from all destinations. Allows * as wildcard
51+
* at end.
52+
*
53+
* NOTE: If excluding headers, they must be in camelCase form to be filtered.
54+
*
55+
* @env NEW_RELIC_ATTRIBUTES_EXCLUDE
56+
*/
57+
exclude: [
58+
'request.headers.cookie',
59+
'request.headers.authorization',
60+
'request.headers.proxyAuthorization',
61+
'request.headers.setCookie*',
62+
'request.headers.x*',
63+
'response.headers.cookie',
64+
'response.headers.authorization',
65+
'response.headers.proxyAuthorization',
66+
'response.headers.setCookie*',
67+
'response.headers.x*'
68+
]
69+
}
70+
}

package-lock.json

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"axios": "^0.20.0",
4848
"body-parser": "^1.19.0",
4949
"cors": "^2.8.5",
50+
"dotenv": "^8.2.0",
5051
"express": "^4.16.4",
5152
"faker": "^4.1.0",
5253
"install": "^0.12.2",

0 commit comments

Comments
 (0)