Server: listen to localhost by default
authorRaphaël Jakse <raphael.trivabble@jakse.fr>
Wed, 6 May 2020 17:47:10 +0000 (19:47 +0200)
committerRaphaël Jakse <raphael.trivabble@jakse.fr>
Wed, 6 May 2020 17:49:08 +0000 (19:49 +0200)
server/trivabble-server.js

index 980e8388ec74c8766ecb05a6d9eb52552cd20da8..07ccc5414a69b322c9c6b75b925a2c9e32fcb9b9 100644 (file)
@@ -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);
     });
 });