2022-08-23 20:08:53 +02:00
|
|
|
import "./init";
|
|
|
|
import { config } from "./config";
|
|
|
|
import Logger from "./logger";
|
|
|
|
import * as db from "./db/database";
|
|
|
|
import * as scheduler from "./jobs/scheduler";
|
|
|
|
import * as router from "./router";
|
|
|
|
import * as app from "./app";
|
2022-07-28 14:45:28 +02:00
|
|
|
import * as mail from "./mail";
|
2020-04-08 03:19:55 +02:00
|
|
|
|
2020-06-30 01:10:18 +02:00
|
|
|
app.init();
|
2022-07-28 15:07:35 +02:00
|
|
|
Logger.init(config.server.logging);
|
2022-08-23 20:08:53 +02:00
|
|
|
Logger.tag("main", "startup").info("Server starting up...");
|
2020-04-08 03:19:55 +02:00
|
|
|
|
2020-06-30 01:10:18 +02:00
|
|
|
async function main() {
|
2022-08-23 20:08:53 +02:00
|
|
|
Logger.tag("main").info("Initializing...");
|
2020-04-08 03:19:55 +02:00
|
|
|
|
2020-06-30 01:10:18 +02:00
|
|
|
await db.init();
|
2022-07-28 14:45:28 +02:00
|
|
|
mail.init();
|
2020-04-08 03:19:55 +02:00
|
|
|
scheduler.init();
|
2020-04-08 23:41:04 +02:00
|
|
|
router.init();
|
2020-04-08 03:19:55 +02:00
|
|
|
|
2022-08-23 20:08:53 +02:00
|
|
|
app.app.listen(config.server.port, "::");
|
2020-06-30 01:10:18 +02:00
|
|
|
}
|
|
|
|
|
2022-08-23 20:08:53 +02:00
|
|
|
main().catch((error) => {
|
|
|
|
console.error("Unhandled runtime error:", error);
|
|
|
|
process.exit(1);
|
|
|
|
});
|