From e6c44668c4e3d4fac95aa505703cf69b8868ea15 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 21 Nov 2019 17:37:30 +0100 Subject: [PATCH] Turn main function into async fashion --- src/main.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index 20a61e4..616b752 100644 --- a/src/main.ts +++ b/src/main.ts @@ -9,8 +9,13 @@ import { DatabaseHelper } from "./helpers/DatabaseHelper"; console.info("Comunic API v6\t@author Pierre HUBERT\t2019-" + new Date().getFullYear()); -console.info("Load configuration..."); -ConfigurationHelper.loadConf("config.json"); +async function init() { + + console.info("Load configuration..."); + ConfigurationHelper.loadConf("config.json"); -console.info("Connect to database"); -DatabaseHelper.connect(); \ No newline at end of file + console.info("Connect to database"); + await DatabaseHelper.connect(); + +} +init(); \ No newline at end of file