From ff0b661f26debb12b72eef50ea90df4fcf4b9336 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Wed, 4 Sep 2019 13:41:07 -0400 Subject: [PATCH] Added port to config --- config.json.example | 1 + index.js | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config.json.example b/config.json.example index b988c6a..9bdc16b 100644 --- a/config.json.example +++ b/config.json.example @@ -1,4 +1,5 @@ { + "port": 80, "globalSalt": "[global salt (pepper) that is added to every ip before hashing to make it even harder for someone to decode the ip]", "adminUserID": "[the hashed id of the user who can perform admin actions]", "behindProxy": true diff --git a/index.js b/index.js index dbabfe8..e1ed7ff 100644 --- a/index.js +++ b/index.js @@ -13,11 +13,11 @@ var db = new sqlite3.Database('./databases/sponsorTimes.db'); //where the more sensitive data such as IP addresses are stored var privateDB = new sqlite3.Database('./databases/private.db'); -// Create an HTTP service. -http.createServer(app).listen(80); - let config = JSON.parse(fs.readFileSync('config.json')); +// Create an HTTP service. +http.createServer(app).listen(config.port); + var globalSalt = config.globalSalt; var adminUserID = config.adminUserID;