-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
67 lines (51 loc) · 1.07 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
const path = require('path');
const rootPath = path.normalize(__dirname);
const port = process.env.PORT || 5566;
const host = process.env.HOST || `localhost:5566`;
const secret = "SECRET_TOKEN";
const env = process.env.NODE_ENV || 'dev';
const qiniu = {
ACCESS_KEY: "you_access_key",
SECRET_KEY: "you_secret_key",
public: {
bucketName: "you_bucketName",
domain: "you_domain"
}
};
const jpush = {
APP_KEY: "you_app_key",
MASTER_SECRET: "you_master_secret"
};
let dev = {
env: env,
secret,
qiniu,
jpush,
root: rootPath,
port: port,
host: host,
db: "mongodb://localhost:27017/lostserver",
jwt: {
tokenSecret: 'TOKEN_SECRET',
expTime: '200h',
isIgnore: true
}
};
let local = {};
if (env === 'local'){
local = {
env: env
};
}
let prod = {};
if (env === 'prod'){
prod = {
env: env,
port: 7878,
schedulePort: 7879,
};
}
let config = dev;
config = Object.assign(config, local, prod);
console.log(config);
module.exports = config;