Typescript migration
* app.js * main.js * router.js
This commit is contained in:
parent
94d01310b9
commit
9652519267
12 changed files with 256 additions and 157 deletions
23
server/main.ts
Executable file
23
server/main.ts
Executable file
|
@ -0,0 +1,23 @@
|
|||
import "./init"
|
||||
import { config } from "./config"
|
||||
import Logger from "./logger"
|
||||
import db from "./db/database"
|
||||
import scheduler from "./jobs/scheduler"
|
||||
import { init as initRouter } from "./router"
|
||||
import app from "./app"
|
||||
|
||||
Logger.tag('main', 'startup').info('Server starting up...');
|
||||
|
||||
db.init()
|
||||
.then(() => {
|
||||
Logger.tag('main').info('Initializing...');
|
||||
|
||||
scheduler.init();
|
||||
initRouter();
|
||||
|
||||
app.listen(config.server.port, '::');
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Could not init database: ', error);
|
||||
process.exit(1);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue