-
Notifications
You must be signed in to change notification settings - Fork 10
/
config.js
45 lines (42 loc) · 882 Bytes
/
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
const convict = require('convict');
const env = require('dotenv').config();
const conf = convict({
env: {
format: ['development', 'production'],
default: 'development',
env: 'NODE_ENV'
},
host: {
format: String,
default: '127.0.0.1',
env: 'HOST'
},
port: {
format: Number,
default: 3000,
env: 'PORT'
},
secret: {
format: String,
default: '',
env: 'SECRET'
},
i18n_dflt_lang: {
format: String,
default: 'en',
env: 'I18N_DFLT_LANG'
},
crx_src_url: {
format: String,
default: '',
env: 'CRX_SRC_URL'
},
crx_max_size: {
format: Number,
default: 20971520,
env: 'CRX_MAX_SIZE'
}
});
// Perform validation
conf.validate();
module.exports = conf.getProperties();