Created
January 5, 2020 13:32
-
-
Save PatrickKalkman/ccfce72c8d50767273f3f964a3f3e18a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const process = require('process'); | |
var app = {}; | |
process.on('SIGINT', function onSigint() { | |
app.shutdown(); | |
}); | |
process.on('SIGTERM', function onSigterm() { | |
app.shutdown(); | |
}); | |
app.shutdown = function () { | |
// clean up your resources and exit | |
process.exit(); | |
}; | |
module.exports = app; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment