projeto-hit/backend/src/server.ts

20 lines
660 B
TypeScript
Raw Normal View History

import gracefulShutdown from "http-graceful-shutdown";
import app from "./app";
import { initIO } from "./libs/socket";
import { logger } from "./utils/logger";
import { StartAllWhatsAppsSessions } from "./services/WbotServices/StartAllWhatsAppsSessions";
import { startSchedulingMonitor } from "./helpers/SchedulingNotifySendMessage"
2022-05-03 21:20:58 +00:00
import { startWhoIsOnlinegMonitor } from "./helpers/WhoIsOnlineMonitor"
const server = app.listen(process.env.PORT, () => {
logger.info(`Server started on port: ${process.env.PORT}`);
});
initIO(server);
StartAllWhatsAppsSessions();
gracefulShutdown(server);
startSchedulingMonitor(5000)
2022-05-03 21:20:58 +00:00
startWhoIsOnlinegMonitor(3000)