Commit 0a6b93a29f063250b810cb0ee07edadb38792229
1 parent
0bd477ce85
Exists in
master
simplified
Showing 1 changed file with 2 additions and 5 deletions Side-by-side Diff
api-server/router-config.js
... | ... | @@ -15,12 +15,9 @@ function getJsonConfig(req, res, next) { |
15 | 15 | } |
16 | 16 | |
17 | 17 | function getConfigElement(req, res, next) { |
18 | - if (!req || !req.params || !req.params.key) { | |
19 | - res.json(config); | |
20 | - return; | |
21 | - } | |
18 | + const key = req && req.params && req.params.key ? req.params.key : 'config'; | |
22 | 19 | |
23 | - res.json(jsonQuery(req.params.key, {config: config})); | |
20 | + res.json(jsonQuery(key, {config: config})); | |
24 | 21 | } |
25 | 22 | |
26 | 23 | router.get('/', getJsonConfig); |