From 3eb99d2635973d0ae9d44bc74e4325a8820925b1 Mon Sep 17 00:00:00 2001 From: nblock Date: Wed, 16 Sep 2020 11:20:13 +0200 Subject: [PATCH] Make host and port configurable (#94) Use the previous values as the default. --- config/default.json | 2 ++ spacedeck.js | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config/default.json b/config/default.json index 57ae30a..1a50908 100644 --- a/config/default.json +++ b/config/default.json @@ -2,6 +2,8 @@ "team_name": "My Open Spacedeck", "contact_email": "support@example.org", + "host": "::", + "port": 9666, "endpoint": "http://localhost:9666", "invite_code": "top-sekrit", diff --git a/spacedeck.js b/spacedeck.js index 4cacaf2..233e21e 100644 --- a/spacedeck.js +++ b/spacedeck.js @@ -114,9 +114,10 @@ module.exports = app; db.init(); // START WEBSERVER -const port = 9666; +const host = config.get('host'); +const port = config.get('port'); -const server = http.Server(app).listen(port, () => { +const server = http.Server(app).listen(port, host, () => { if ("send" in process) { process.send('online');