diff --git a/instances/default/config.json b/instances/default/config.json index 8f9c326..5c0de57 100644 --- a/instances/default/config.json +++ b/instances/default/config.json @@ -1,4 +1,8 @@ { + "app": { + "name": "Secret Sender", + "url": "https://127.0.0.1:3443" + }, "servers": [ { "features": { diff --git a/src/core/config.js b/src/core/config.js index 77e7300..4013326 100644 --- a/src/core/config.js +++ b/src/core/config.js @@ -10,6 +10,8 @@ const load = () => { throw new Error('Config file not found') } _config = JSON.parse(fs.readFileSync(_configFile)) + if(! _config.app) _config.app = {} + if(! _config.app.name) _config.app.name = 'Secret Sender' } if(! _config) load() diff --git a/src/core/routes.js b/src/core/routes.js index ca9066e..c9ec1ed 100644 --- a/src/core/routes.js +++ b/src/core/routes.js @@ -1,7 +1,9 @@ import bodyParser from "body-parser" +import config from "./config.js" import vault from "./vault.js" -const _title = "Secret Sender" +const _config = config.get() +const _title = _config.app.name const load = (router, features) => {