-
Notifications
You must be signed in to change notification settings - Fork 26
/
plugins.js
54 lines (46 loc) · 975 Bytes
/
plugins.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
'use strict'
/**
* Vendor modules
*/
const Inert = require('inert')
const Vision = require('vision')
const HapiSwagger = require('hapi-swagger')
const Good = require('good')
const config = require('config')
/**
* Internal modules
*/
const Package = require('./package.json')
const DEVELOPMENT = 'development'
/**
* exports array of plugins with configuration.
* @type {Array}
*/
let plugins = []
if (config.util.getEnv('NODE_ENV') === DEVELOPMENT) {
// add hapi swagger integration
plugins = plugins.concat([Inert,
Vision,
{
register: HapiSwagger,
options: {
info: {
'title': Package.description,
'version': Package.version
},
pathPrefixSize: 4
}
}])
// add good console for log reporting
plugins.push({
register: Good,
options: {
reporters: {
console: [{
module: 'good-console'
}, 'stdout']
}
}
})
}
module.exports = plugins