Skip to content

Commit

Permalink
Update app.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
gitdog01 authored Dec 27, 2023
1 parent b2e0137 commit 140cd08
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,17 @@ app.use((_, res) => {
app.listen(Bun.env.SERVER_PORT, () => {
console.log(`Bun server on : ${Bun.env.SERVER_PORT}`);
});

process.on('SIGINT', () => {
console.log('SIGINT signal received: closing HTTP server');
server.close(() => {
console.log('HTTP server closed');
});
});

process.on('SIGTERM', () => {
console.log('SIGTERM signal received: closing HTTP server');
server.close(() => {
console.log('HTTP server closed');
});
});

0 comments on commit 140cd08

Please sign in to comment.