terminate properly

This commit is contained in:
Robin Appelman 2017-04-17 15:31:02 +02:00
commit fb8d8f354f

View file

@ -66,3 +66,10 @@ app.post('/url', function (req, res) {
app.listen(app.get('port'), function () {
console.log("Node app is running at localhost:" + app.get('port'));
});
process.on('SIGINT', function () {
process.exit();
});
process.on('SIGTERM', function () {
process.exit();
});