feat: add graceful shutdown handlers for SIGINT and SIGTERM

This commit is contained in:
2026-03-09 14:16:28 -06:00
parent a6642bc2cc
commit cb7e4d3449
2 changed files with 11 additions and 1 deletions

View File

@@ -546,6 +546,16 @@ async function initializeServer() {
}
})
process.on('SIGINT', () => {
log.info('Shutting down server...')
server.stop()
})
process.on('SIGTERM', () => {
log.info('Shutting down server...')
server.stop()
})
log.success(`Server listening on http://localhost:${String(server.port)}`)
}