diff --git a/conf.json b/conf.json new file mode 100644 index 0000000..9742678 --- /dev/null +++ b/conf.json @@ -0,0 +1,22 @@ +{ + "port": 5000, + "sessionSecret": "super_duper_secret_secret", + "users": [ + { + "username": "jeff", + "password": "bb75cb47ec1c1132d25bf2afbc3e10ea0181748c9bdef8e0909f2cbabd4cad57", + "id": 1, + "salt": "4a9cbd94309329e9591b60a3def16d10724cb89444deee357a3eb0dd1e95d683", + "admin": true, + "api": "39c75cfe9b367ccf2bf1fe5451e1f7a966f653abb827db6bb96a2f532776df49" + }, + { + "username": "josh", + "api": "5fb6cc61e5589b302b7383d98e7412cde8d04491a6e5d765445d334331a752e7", + "id": 2, + "salt": "4d7159f4d6aa4ee3467a13ef7a7a3ec17ae4b560756673c21eeee8bc887ab3c9", + "password": "320142ed202563b462b744f221cbc236cb042efda47b550395a32920f0dd937c", + "admin": false + } + ] +} \ No newline at end of file diff --git a/configManager.js b/configManager.js index f568902..405d06f 100644 --- a/configManager.js +++ b/configManager.js @@ -1,13 +1,20 @@ -module.exports = - { +const fileIO = require('./fileIO'); +const CONFIG_FILE_NAME = "conf.json"; + +const config = fileIO.getFileAsJSON(CONFIG_FILE_NAME); + +module.exports= +{ getConfiguration: function() { - + return config; }, syncToDisk: function() { - + fileIO.writeJSONToFile(CONFIG_FILE_NAME, config); + // console.log(config); + // console.log("Config Updated"); } - }; \ No newline at end of file +}; \ No newline at end of file diff --git a/html/header.html b/html/header.html index fc3e180..a40c60a 100644 --- a/html/header.html +++ b/html/header.html @@ -38,7 +38,7 @@