-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
81 lines (76 loc) · 1.64 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
69
70
71
72
73
74
75
76
77
78
79
80
var Confidence = require('confidence')
, path = require('path');
var criteria, store;
store = new Confidence.Store({
server: {
$filter: 'env',
production: {
port: process.env.PORT
},
$default: {
port: 8080
}
},
debug: {
$filter: 'env',
production: {
request: ['error']
},
$default: {
request: ['error'],
log: ['error']
}
},
cache: {
$filter: 'env',
production: {
engine: require('catbox-redis'),
host: process.env.REDISHOST !== null ? process.env.REDISHOST : void 0,
port: process.env.REDISPORT !== null ? process.env.REDISPORT : void 0,
password: process.env.REDISPWD !== null ? process.env.REDISPWD : void 0,
partition: 'Kwik-E-Mart'
// name: 'seperate cache name'
},
$default: {
engine: require('catbox-redis'),
partition: 'Kwik-E-Mart'
}
},
database: {
host: '127.0.0.1:5984',
database: 'kwik-e-mart',
adminprefix: 'admin-'
},
plugins: {
$filter: 'env',
production: {},
$default: {
justify: {
adminprefix: 'admin-',
auth: {
password: 'secret',
cookie: 'sid-example',
redirectTo: '/login',
isSecure: false
},
cacheExpiration: 3 * 24 * 60 * 60 * 1000,
cacheSegment: 'sessions',
redirectOnSuccess: '/admin'
},
relax: {
nano : {
db: 'kwik-e-mart'
},
user: 'root',
password: 'asdf',
prefix: 'couch'
}
}
}
});
criteria = {
env: process.env.ENVIRONMENT
};
exports.get = function(key) {
return store.get(key, criteria);
};