From: Raphaƫl Jakse Date: Wed, 6 May 2020 17:47:10 +0000 (+0200) Subject: Server: listen to localhost by default X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=378e7f6d14a8824e3af93d6318b2c7a028c00211;p=trivabble.git Server: listen to localhost by default --- diff --git a/server/trivabble-server.js b/server/trivabble-server.js index 980e838..07ccc54 100644 --- a/server/trivabble-server.js +++ b/server/trivabble-server.js @@ -28,6 +28,8 @@ "use strict"; const port = parseInt(process.env.TRIVABBLE_PORT || "3000"); +const host = process.env.TRIVABBLE_HOST || "localhost" + const SAVE_TIMEOUT = 5000; const KEEP_ALIVE = 30000; const GAMES_BACKUP = process.env.TRIVABBLE_GAMES_BACKUP || "games.backup.json"; @@ -1187,7 +1189,7 @@ fs.readFile(GAMES_BACKUP, function (err, data) { console.error("An error happened in the HTTP server", error); }); - server.listen(port, function() { + server.listen(port, host, function() { console.log("Server listening on: http://localhost:%s", port); }); });