wildflock/index.ts
Sergo d5e92d075e
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline failed
adjust index file
2023-07-30 10:27:00 +03:00

34 lines
764 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);
});