-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
48 lines (42 loc) · 962 Bytes
/
index.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
const hapi = require('hapi')
const good = require('good')
const keeper = require('hapi-greenkeeper-keeper')
const goodOptions = {
ops: {
interval: 1000 * 60
},
reporters: {
console: [{
module: 'good-console',
args: [{ log: '*', response: '*', ops: '*' }]
}, 'stdout']
}
}
const server = new hapi.Server()
server.connection({ port: process.env.PORT || 8080 })
server.register([
{
register: good,
options: goodOptions
},
{
register: keeper,
options: {
github: {
token: process.env.GITHUB_TOKEN
},
squash: process.env.SQUASH_MERGES || false,
deleteBranches: process.env.DELETE_BRANCHES || true
}
}
], (error) => {
if (error) {
return console.error(error)
}
server.start((error) => {
if (error) {
return server.log(['app', 'start', 'error'], error)
}
server.log(['app', 'start'], `Server started at ${server.info.uri}`)
})
})