ffffng/server/main.ts
baldo e48c2861c6 Make new frontend deployable.
* Get rid of old client and its grunt build.
* Make `yarn run dist` bundle a working version with new frontend.
* Make sure to handle history mode URLs on server side.
2022-10-04 17:53:45 +02:00

26 lines
628 B
TypeScript
Executable file

import "./init";
import { config } from "./config";
import Logger from "./logger";
import * as db from "./db/database";
import * as scheduler from "./jobs/scheduler";
import * as app from "./app";
import * as mail from "./mail";
app.init();
Logger.init(config.server.logging);
Logger.tag("main", "startup").info("Server starting up...");
async function main() {
Logger.tag("main").info("Initializing...");
await db.init();
mail.init();
scheduler.init();
app.app.listen(config.server.port, "::");
}
main().catch((error) => {
console.error("Unhandled runtime error:", error);
process.exit(1);
});