2020-04-08 03:19:55 +02:00
|
|
|
import "./init"
|
|
|
|
import { config } from "./config"
|
|
|
|
import Logger from "./logger"
|
2020-04-08 22:05:53 +02:00
|
|
|
import * as db from "./db/database"
|
2020-04-08 23:41:04 +02:00
|
|
|
import * as scheduler from "./jobs/scheduler"
|
|
|
|
import * as router from "./router"
|
2020-04-08 03:19:55 +02:00
|
|
|
import app from "./app"
|
|
|
|
|
|
|
|
Logger.tag('main', 'startup').info('Server starting up...');
|
|
|
|
|
|
|
|
db.init()
|
|
|
|
.then(() => {
|
|
|
|
Logger.tag('main').info('Initializing...');
|
|
|
|
|
|
|
|
scheduler.init();
|
2020-04-08 23:41:04 +02:00
|
|
|
router.init();
|
2020-04-08 03:19:55 +02:00
|
|
|
|
|
|
|
app.listen(config.server.port, '::');
|
|
|
|
})
|
|
|
|
.catch(error => {
|
|
|
|
console.error('Could not init database: ', error);
|
|
|
|
process.exit(1);
|
|
|
|
});
|