1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-22 05:19:22 +00:00

Split main function into two functions

This commit is contained in:
Pierre HUBERT 2020-05-25 18:13:01 +02:00
parent 26f6c12f35
commit 1198e28696

View File

@ -25,6 +25,14 @@ async function init() {
console.info("Connect to database");
await DatabaseHelper.connect();
await startServer();
}
init();
/**
* Run the server
*/
async function startServer() {
// Start HTTP Server
const app = expressWs(express()).app;
@ -101,5 +109,4 @@ async function init() {
app.listen(conf().port, () => {
console.info("Started server on http://127.0.0.1:" + conf().port);
});
}
init();
}