-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
49 lines (44 loc) · 1.09 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
const extend = require('node.extend');
let env = process.env.NODE_ENV; // development or test or production
if (!env) {//默认赋值
env = 'dev';
}
if (env !== 'dev' && env !== 'test' && env !== 'prod') {//避免特殊情况
env = 'dev';
}
const settings = {
base: {
appName: 'ShouLou',
port: 4001,
tokenExpiresIn: '1days',
tokenIssuer: 'server',
tokenAudience: 'client',
tokenSubject: 'shoulou'
},
dev: {
port: 4002,
agUrl: 'http://112.74.143.61:8081/v1/',
token: 'DTuuuvdWNqENxCd2Af57',
appID: 'ICECAIUI-C9A1-4DBF-9972-B21DA0CFEFC4',
agTimeout: 20000,
logLevel: 'TRACE'
},
test: {
port: 4001,
agUrl: 'http://112.74.143.61:8081/v1/',
token: 'DTuuuvdWNqENxCd2Af57',
appID: 'ICECAIUI-C9A1-4DBF-9972-B21DA0CFEFC4',
agTimeout: 20000,
logLevel: 'INFO'
},
prod: {
port: 80,
agUrl: 'http://112.74.143.61:8081/v1/',
token: 'DTuuuvdWNqENxCd2Af57',
appID: 'ICECAIUI-C9A1-4DBF-9972-B21DA0CFEFC4',
agTimeout: 10000,
logLevel: 'INFO'
}
};
const c = settings[env];
module.exports = extend(settings.base, c);