update global config key get

This commit is contained in:
Arthur Lu 2024-09-25 22:51:30 +00:00
parent ee3e768ada
commit 42dea83463

View File

@ -20,7 +20,9 @@ router.get("/config/:key", async (req, res) => {
const allowKeys = ["resources"]; const allowKeys = ["resources"];
if (allowKeys.includes(params.key)) { if (allowKeys.includes(params.key)) {
const config = global.config; const config = global.config;
res.status(200).send(config[params.key]); const result = {}
result[params.key] = config[params.key]
res.status(200).send(result);
} }
else { else {
res.status(401).send({ auth: false, error: `User is not authorized to access /global/config/${params.key}.` }); res.status(401).send({ auth: false, error: `User is not authorized to access /global/config/${params.key}.` });