diff --git a/templates/js/www.ejs b/templates/js/www.ejs index 690fc488..7f8403e8 100644 --- a/templates/js/www.ejs +++ b/templates/js/www.ejs @@ -88,3 +88,10 @@ function onListening() { : 'port ' + addr.port; debug('Listening on ' + bind); } + +process.on('SIGTERM', function() { + debug('SIGTERM signal received: closing server'); + server.close( function () { + debug('Http server closed'); + }); +});