refactor(config) config.serve -> config()

This commit is contained in:
coderaiser 2014-10-17 09:18:01 -04:00
parent 4132ffaed4
commit 2cf35bd8f4
2 changed files with 8 additions and 7 deletions

View file

@ -77,7 +77,7 @@
funcs = [
authFunc,
config.serve,
config(),
rest,
route,

View file

@ -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 {