From 7eb0558e9633dc33d38219c9f34fe3f1854943a7 Mon Sep 17 00:00:00 2001 From: TheGreyDiamond Date: Tue, 6 Jul 2021 17:01:34 +0200 Subject: [PATCH] Get port from config --- config/default.json.example | 1 + index.ts | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/default.json.example b/config/default.json.example index 7eaab0e..1d83b72 100644 --- a/config/default.json.example +++ b/config/default.json.example @@ -3,6 +3,7 @@ "mapboxAccessToken": "", "cookieSecret": "", "serverAdress": "", + "port": 3000, "mysql": { "user": "", "password": "", diff --git a/index.ts b/index.ts index 03b25ee..38b8866 100644 --- a/index.ts +++ b/index.ts @@ -127,10 +127,8 @@ app.use(csp.contentSecurityPolicy({ })) */ -// Settings -const port = 3000; -const startUpTime = Math.floor(new Date().getTime() / 1000); +const startUpTime = Math.floor(new Date().getTime() / 1000); let fontawesomeKey = ""; let mapboxAccessToken = ""; @@ -140,6 +138,7 @@ let mailConf = { "host": "", "port": 0, "username": "", "password": "" }; let serverAdress = ""; let cookieSecret = "" let jsonConfigGlobal = {}; +let port = 3000; // Load config try { @@ -159,6 +158,7 @@ try { mailConf = jsonConfig.mail; serverAdress = jsonConfig.serverAdress; + port = jsonConfig.port; cookieSecret = jsonConfig.cookieSecret || "saF0DSF65AS4DF0S4D6F0S54DF0Fad"; jsonConfigGlobal = jsonConfig;