1
0

Add app in config

This commit is contained in:
MatMoul 2024-10-27 22:32:36 +01:00
parent cf888674e0
commit b2ff77e7d3
3 changed files with 9 additions and 1 deletions

View File

@ -1,4 +1,8 @@
{ {
"app": {
"name": "Secret Sender",
"url": "https://127.0.0.1:3443"
},
"servers": [ "servers": [
{ {
"features": { "features": {

View File

@ -10,6 +10,8 @@ const load = () => {
throw new Error('Config file not found') throw new Error('Config file not found')
} }
_config = JSON.parse(fs.readFileSync(_configFile)) _config = JSON.parse(fs.readFileSync(_configFile))
if(! _config.app) _config.app = {}
if(! _config.app.name) _config.app.name = 'Secret Sender'
} }
if(! _config) load() if(! _config) load()

View File

@ -1,7 +1,9 @@
import bodyParser from "body-parser" import bodyParser from "body-parser"
import config from "./config.js"
import vault from "./vault.js" import vault from "./vault.js"
const _title = "Secret Sender" const _config = config.get()
const _title = _config.app.name
const load = (router, features) => { const load = (router, features) => {