forked from dadah/zmq-broker-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.js
64 lines (62 loc) · 1.62 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
(function() {
var convict = require('convict');
var config = module.exports = convict({
env: {
doc: "The application environment.",
format: ["production", "development", "test", "staging"],
default: "development",
env: "NODE_ENV",
arg: "node-env",
},
debug: {
doc: "The application's debug level",
format: [0, 1, 2],
default: 2,
env: "NODE_DEBUG",
arg: "node-debug"
},
broker: {
backend: {
doc: "The backend endpoint on broker",
default: "tcp://127.0.0.1:7776"
},
frontend: {
doc: "The frontend endpoint on broker",
default: "tcp://127.0.0.1:7777"
},
smi: {
heartbeat: {
doc: "The Service Management Interface heartbeat interval (ms)",
default: 1000
},
maxTTL: {
doc: "The Service Management Interface max TTL for a service (ms)",
default: 2000
},
updateInterval: {
doc: "The Service Management Interface refresh interval (ms)",
default: 500
}
}
},
log: {
consolePlugin: {
level: {
doc: "The Console log pluggin level",
default: 'info'
},
timeFormat: {
doc: "The Console log pluggin timeFormat",
default: 'YYYY-MM-DD HH:mm:ss'
},
messageFormat: {
doc: "The Console log pluggin messageFormat",
default: '%time | %level | %logger - %msg'
}
}
}
});
var path = process.env.ZSS_CONFIG;
var env = config.get('env');
config.loadFile(path + '/' + env + '.json');
}());