|
|
|
@ -47,9 +47,15 @@ app.use(function(err, req, res, next) { |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// listen for TERM signal .e.g. kill
|
|
|
|
|
process.on ('SIGTERM', ()=>process.exit()); |
|
|
|
|
process.on ('SIGTERM', ()=>{ |
|
|
|
|
process.exit() |
|
|
|
|
console.info('SIGTERM退出') |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// listen for INT signal e.g. Ctrl-C
|
|
|
|
|
process.on ('SIGINT', ()=>process.exit()); |
|
|
|
|
process.on ('SIGINT', ()=>{ |
|
|
|
|
process.exit() |
|
|
|
|
console.info('SIGINT退出') |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
module.exports = app; |
|
|
|
|