Merge pull request #89 from kevinastone/patch-2

Gracefully shutdown on both SIGINT + SIGTERM
This commit is contained in:
Matt Walsh
2025-05-29 20:02:43 -05:00
committed by GitHub

View File

@@ -99,8 +99,11 @@ const server = app.listen(port, () => {
});
// graceful shutdown
process.on('SIGINT', () => {
const gracefulShutdown = () => {
server.close(() => {
console.log('Server closed');
});
});
};
process.on('SIGINT', gracefulShutdown);
process.on('SIGTERM', gracefulShutdown);