POGOserver/src/setup.js
Felix f4558676a6 Update
- Handle db errors and try to reconnect instead of crash
2016-08-16 22:46:33 +02:00

26 lines
511 B
JavaScript

import path from "path";
import * as CFG from "../cfg";
export function setup() {
this.print("Booting server..", 33);
this.createAssetDownloadSession().then(() => {
this.setupDatabaseConnection().then(() => {
if (CFG.SERVER_PORT < 1) {
this.print("Invalid port!", 31);
return void 0;
}
this.socket = this.createHTTPServer();
setTimeout(this::this.cycle, 1);
this.print(`Server running at ${CFG.SERVER_HOST_IP}:${CFG.SERVER_PORT}`);
});
});
}