From 42dea834631b162cb4c72fdb0270a1c7ea719a1d Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Wed, 25 Sep 2024 22:51:30 +0000 Subject: [PATCH] update global config key get --- src/routes/global.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/routes/global.js b/src/routes/global.js index 4b3393d..74ca9cc 100644 --- a/src/routes/global.js +++ b/src/routes/global.js @@ -20,7 +20,9 @@ router.get("/config/:key", async (req, res) => { const allowKeys = ["resources"]; if (allowKeys.includes(params.key)) { 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 { res.status(401).send({ auth: false, error: `User is not authorized to access /global/config/${params.key}.` });