Add simple handling of SIGINT/SIGTERM for Docker

This commit is contained in:
Jerko Steiner 2019-11-18 23:12:14 -03:00
parent 0978bbd25b
commit c7030bd3bb

View File

@ -4,11 +4,12 @@ if (!process.env.DEBUG) {
}
import _debug from 'debug'
import forEach from 'lodash/forEach'
import { io } from './server/app'
import app from './server/app'
const debug = _debug('peercalls')
const port = process.env.PORT || 3000
app.listen(port, () => debug('Listening on: %s', port))
process.on('SIGINT', () => process.exit())
process.on('SIGTERM', () => process.exit())