-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
32 lines (29 loc) · 1.18 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const env = require('env-var').from({
// Default values to use if not defined in the environment
ADMIN_PASS: 'r3dh4t1!',
MONGO_URL: 'localhost:27017/qiot',
MONGO_CREDENTIALS: 'qiot:qiot',
DB_NAME: 'qiot',
STATIONS_COL: 'measurementstation',
HISTORIC_COL: 'measurementhistory',
MONTH_COL: 'measurementbymonth',
DAY_COL: 'measurementbyday',
HOUR_COL: 'measurementbyhour',
MINUTE_COL: 'measurementbyminute',
DB_SERVICE: 'http://qiot-query-qiot.apps.cluster-emeaiot-d864.emeaiot-d864.example.opentlc.com/v1/snapshot/id/',
// Include environment values. These will take precedence over
// the defaults defined above if defined
...process.env
})
module.exports = {
adminPassword: env.get('ADMIN_PASS').asString(),
mongoURL: env.get('MONGO_URL').asString(),
mongoCredentials: env.get('MONGO_CREDENTIALS').asString(),
dbName: env.get('DB_NAME').asString(),
stationsCollection: env.get('STATIONS_COL').asString(),
historicCollection: env.get('HISTORIC_COL').asString(),
monthlyCollection: env.get('MONTH_COL').asString(),
dailyCollection: env.get('DAY_COL').asString(),
hourlyCollection: env.get('HOUR_COL').asString(),
dbService: env.get('DB_SERVICE').asString()
}