From c7030bd3bb3ff76ee47d518a7e035c7ac25a9247 Mon Sep 17 00:00:00 2001 From: Jerko Steiner Date: Mon, 18 Nov 2019 23:12:14 -0300 Subject: [PATCH] Add simple handling of SIGINT/SIGTERM for Docker --- src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 61359d3..52aeeba 100755 --- a/src/index.ts +++ b/src/index.ts @@ -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())