2023-09-02 12:13:50 +00:00
|
|
|
import 'dotenv/config';
|
2024-07-28 12:32:41 +00:00
|
|
|
import './init.js';
|
|
|
|
import { initUdpServer } from './udp/server.js';
|
2023-10-03 11:47:17 +00:00
|
|
|
import { createServer } from 'http';
|
2024-07-28 12:32:41 +00:00
|
|
|
import { initSocketio } from './ws/index.js';
|
|
|
|
import { monitorManager } from './model/monitor/index.js';
|
|
|
|
import { env } from './utils/env.js';
|
|
|
|
import { initCronjob } from './cronjob/index.js';
|
|
|
|
import { logger } from './utils/logger.js';
|
|
|
|
import { app } from './app.js';
|
2024-09-30 23:37:27 +00:00
|
|
|
import { runMQWorker } from './mq/worker.js';
|
2023-09-02 17:01:55 +00:00
|
|
|
|
2024-01-13 10:16:09 +00:00
|
|
|
const port = env.port;
|
2023-08-31 13:17:57 +00:00
|
|
|
|
2023-10-03 11:47:17 +00:00
|
|
|
const httpServer = createServer(app);
|
2023-08-31 13:17:57 +00:00
|
|
|
|
2023-09-30 16:01:43 +00:00
|
|
|
initUdpServer(port);
|
|
|
|
|
2023-10-03 11:47:17 +00:00
|
|
|
initSocketio(httpServer);
|
2023-09-18 08:08:16 +00:00
|
|
|
|
2024-01-05 15:05:19 +00:00
|
|
|
initCronjob();
|
|
|
|
|
2024-09-30 23:37:27 +00:00
|
|
|
runMQWorker();
|
|
|
|
|
2023-10-04 17:56:33 +00:00
|
|
|
monitorManager.startAll();
|
|
|
|
|
2023-10-03 11:47:17 +00:00
|
|
|
httpServer.listen(port, () => {
|
2024-01-20 08:22:44 +00:00
|
|
|
logger.info(`Server is listening on port ${port}...`);
|
|
|
|
if (env.allowOpenapi) {
|
|
|
|
logger.info(`Openapi UI: http://127.0.0.1:${port}/open/_ui`);
|
|
|
|
}
|
|
|
|
logger.info(`Website: http://127.0.0.1:${port}`);
|
2023-08-31 13:17:57 +00:00
|
|
|
});
|