-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.js
executable file
·68 lines (56 loc) · 1.9 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
65
66
67
68
const path = require('path');
const pkg = localRequire('package');
const env = process.env.NODE_ENV || 'development';
exports.version = pkg.version;
exports.env = env;
exports.port = process.env.PORT || 5018;
exports.app = pkg.name;
exports.name = process.env.NAME || 'unknown';
// exports.domain = 'albi.io';
// http://user:pass@127.0.0.1:8086/mydatabase
exports.influx = process.env.INFLUX;
// app url prefix for all request
exports.appUrlPrefix = process.env.APP_URL_PREFIX || '';
exports.staticOptions = {
urlPrefix: '/static',
path: env === 'development' ? path.join(__dirname, 'public') : path.join(__dirname, 'assets'),
maxAge: env === 'development' ? 0 : 365 * 24 * 3600,
headers: {
Vary: 'Accept-Encoding',
},
host: process.env.STATIC_HOST || '',
};
// view root path
exports.viewPath = path.join(__dirname, 'views');
// jspm file path
exports.jspmPath = path.join(__dirname, 'jspm');
// user track cookie
exports.trackCookie = '_jt';
/* eslint max-len:0 */
exports.httpLogFormat = ':user :request-id :method :url :status :length ":referrer"';
// http connection limit options
exports.connectLimitOptions = {
mid: 100,
high: 500,
interval: 5000,
};
// cookie name
exports.session = {
key: pkg.name,
ttl: 48 * 3600 * 1000,
maxAge: 36 * 3600 * 1000,
};
// admin token (jenny)
exports.adminToken = '6a3f4389a53c889b623e67f385f28ab8e84e5029';
// etcd server address http://192.168.99.100:2379/v2
exports.etcd = process.env.ETCD;
// application binding ip address
exports.IP = process.env.IP;
// mongodb uri
// mongodb://user:pass@localhost:port,anotherhost:port,yetanother:port/mydatabase
exports.mongoUri = process.env.MONGO || 'mongodb://127.0.0.1/aslant';
// redis uri
// [redis:]//[[user][:password@]][host][:port][/db-number][?db=db-number[&password=bar[&option=value]]]
exports.redisUri = process.env.REDIS || 'redis://127.0.0.1/';
// udp://127.0.0.1:6000
exports.udpLog = process.env.UDP_LOG;