-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.js
53 lines (44 loc) · 1.31 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
const environment = process.env.ENVIRONMENT
const isProduction = environment === 'prd'
module.exports = {
blipp: {
showAuth: true
},
jwt: {
key: process.env.JWT_SECRET,
verifyOptions: { algorithms: ['HS256'] }
},
// This config is specifically for hapi-pino which was added to replace the deprecated (and noisy!) hapi/good. At
// some point all logging would go through this. But for now, it just covers requests & responses
log: {
// Credit to https://stackoverflow.com/a/323546/6117745 for how to handle
// converting the env var to a boolean
logInTest: (String(process.env.LOG_IN_TEST) === 'true') || false,
level: process.env.WRLS_LOG_LEVEL || 'warn'
},
// This config is used by water-abstraction-helpers and its use of Winston and Airbrake. Any use of `logger.info()`,
// for example, is built on this config.
logger: {
level: process.env.WRLS_LOG_LEVEL || 'warn',
airbrakeKey: process.env.ERRBIT_KEY,
airbrakeHost: process.env.ERRBIT_SERVER,
airbrakeLevel: 'error'
},
pg: {
connectionString: process.env.DATABASE_URL,
max: 6,
idleTimeoutMillis: 10000,
connectionTimeoutMillis: 5000
},
server: {
port: 8004,
router: {
stripTrailingSlash: true
}
},
licence: {
regimeId: 1,
typeId: 8
},
isProduction
}