Migrate to version 2 of nodes.json and start adding tests

This commit is contained in:
baldo 2020-06-30 01:10:18 +02:00
commit fb87695b3e
23 changed files with 7352 additions and 1228 deletions
server

View file

@ -1,23 +1,28 @@
import "./init"
import { config } from "./config"
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 app from "./app"
import * as app from "./app"
app.init();
Logger.init();
Logger.tag('main', 'startup').info('Server starting up...');
db.init()
.then(() => {
async function main() {
Logger.tag('main').info('Initializing...');
await db.init();
scheduler.init();
router.init();
app.listen(config.server.port, '::');
})
.catch(error => {
console.error('Could not init database: ', error);
process.exit(1);
});
app.app.listen(config.server.port, '::');
}
main()
.catch(error => {
console.error('Unhandled runtime error:', error);
process.exit(1);
});