mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
refactor(config) config.serve -> config()
This commit is contained in:
parent
4132ffaed4
commit
2cf35bd8f4
2 changed files with 8 additions and 7 deletions
|
|
@ -77,7 +77,7 @@
|
|||
|
||||
funcs = [
|
||||
authFunc,
|
||||
config.serve,
|
||||
config(),
|
||||
rest,
|
||||
route,
|
||||
|
||||
|
|
|
|||
|
|
@ -31,15 +31,17 @@
|
|||
|
||||
module.exports = set;
|
||||
module.exports.save = save;
|
||||
module.exports.serve = serve;
|
||||
|
||||
function set(key, value) {
|
||||
var result;
|
||||
|
||||
if (value === undefined)
|
||||
result = config[key];
|
||||
if (key)
|
||||
if (value === undefined)
|
||||
result = config[key];
|
||||
else
|
||||
config[key] = value;
|
||||
else
|
||||
config[key] = value;
|
||||
result = middle;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
@ -57,8 +59,7 @@
|
|||
});
|
||||
}
|
||||
|
||||
function serve(req, res, next) {
|
||||
console.log(req.url)
|
||||
function middle(req, res, next) {
|
||||
if (req.url !== apiURL + '/config') {
|
||||
next();
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue