-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.js
38 lines (36 loc) · 987 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
const convict = require('convict')
const conf = convict({
env: {
doc: 'The applicaton environment.',
format: ['production', 'development', 'test', 'qa'],
default: 'development',
env: 'NODE_ENV',
arg: 'node_env'
},
connectWithCollection: {
doc:
'Whether to use collection names as part of the connection string, generating a new database instance for each collection',
format: Boolean,
default: false
},
database: {
path: {
doc: 'Path to the database file',
format: String,
default: 'workspace/db'
},
autosaveInterval: {
doc: 'Interval (in milliseconds) for persisting data to disk',
format: Number,
default: 5000
},
serializationMethod: {
doc: 'LokiJS serialisation method',
format: ['normal', 'pretty'],
default: 'normal'
}
}
})
// Load environment dependent configuration.
conf.loadFile(`./config/filestore.${conf.get('env')}.json`)
module.exports = conf