-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
38 lines (31 loc) · 836 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
const bunyan = require('bunyan')
const { bootstrap } = require('./src')
/* eslint-disable */
const logger = bunyan.createLogger({
name: process.env.npm_package_name || require('./package').name,
version: process.env.npm_package_version || require('./package').version,
});
bootstrap({ logger })
.then(() => {
logger.info('Completed!')
process.exit(0)
})
.catch((e) => {
logger.error(e)
process.exit(1)
})
process.on('SIGTERM', () => {
logger.info('Got SIGTERM')
process.exit(0)
})
process.on('SIGINT', () => {
logger.info('Got SIGINT')
process.exit(0)
})
process.on('unhandledRejection', (e, promise) => {
logger.log('Unhandled Rejection at:', promise, 'reason:', e)
process.exit(1)
})
process.on('uncaughtException', () => {
process.exit(1)
})