wildflock/index.ts
Sergo c60d7d0c30
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
change prettier config
2023-08-06 09:09:48 +03:00

34 lines
796 B
TypeScript

import { app } from './app';
import { logger } from './logger';
const port = app.get('port');
const host = app.get('host');
const server = app.listen(port);
app.listen(port).then(() => {
logger.info(`Walias app listening on http://${host}:${port}`);
});
process.on('SIGINT', () => {
logger.info('Received SIGINT signal. Shutting down gracefully.');
server.close(() => {
logger.info('HTTP server closed.');
process.exit(0);
});
});
process.on('SIGTERM', () => {
logger.info('Received SIGTERM signal. Shutting down gracefully.');
server.close(() => {
logger.info('HTTP server closed.');
process.exit(0);
});
});
process.on('unhandledRejection', reason => {
logger.error('Unhandled rejection', reason);
process.exit(1);
});