Server: listen to localhost by default

This commit is contained in:
Raphaël Jakse 2020-05-06 19:47:10 +02:00
parent 9ce9945b2b
commit 378e7f6d14
1 changed files with 3 additions and 1 deletions

View 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);
});
});