-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
64 lines (44 loc) · 1.08 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
var
config = {}
, _ = require('lodash')
, changeEnvironment = function(env){
if (env === null || !config.hasOwnProperty(env)) env = 'dev';
for (var key in module.exports) delete module.exports[key];
var _config = {};
_config = _.merge( _.clone(config.default), config[env] );
for (key in _config) module.exports[key] = _config[key];
module.exports.env = env;
module.exports.changeEnvironment = changeEnvironment;
}
;
config.default = {
defaults: {
limit: 30
}
, port: process.env.ENRG_HTTP_PORT || 3000
, db: {
dateFormat: '{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}'
, connString: 'postgres://localhost:5432/enrg'
}
, bcrypt: {
workFactor: 4
}
, nmt: {
remoteLeqPath: '/NMT/NMTDATA/MINUTE'
, localLeqPath: './data/:nmtId/minute'
, datMinSize: 1448
}
};
config.test = {
port: 4000
, db: {
dateFormat: '{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}'
, connString: 'postgres://localhost:5432/enrg_test'
}
};
config.dev = {
};
config.production = {
};
module.exports = {};
changeEnvironment( process.env.ENRG_ARTEMIS_ENV );