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

@@ -17,6 +17,7 @@
"@vitejs/plugin-react-swc": "^4.2.3",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"vite-tsconfig-paths": "^6.1.1",
},
"devDependencies": {
"@biomejs/biome": "2.4.5",
@@ -29,7 +30,6 @@
"husky": "^9.1.7",
"lint-staged": "^16.3.2",
"vite": "^7.3.1",
"vite-tsconfig-paths": "^6.1.1",
},
"peerDependencies": {
"typescript": "^5.9.3",

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)}`)
}