From 1198e28696dc1e55cb1f036b666a1db64aaeafc1 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 25 May 2020 18:13:01 +0200 Subject: [PATCH] Split main function into two functions --- src/main.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 199a315..81875ac 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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(); \ No newline at end of file +} \ No newline at end of file