Commit 8b48b7e0 authored by Dominic Tarr's avatar Dominic Tarr

[minor] code style changes

parent caa1f494
...@@ -180,8 +180,7 @@ exports.createServer = function () { ...@@ -180,8 +180,7 @@ exports.createServer = function () {
host: host host: host
}); });
} }
if(middleware.length) if(middleware.length) middleware.push(handler)
middleware.push(handler)
} }
else if (proxy.proxyTable) { else if (proxy.proxyTable) {
// //
...@@ -191,14 +190,10 @@ exports.createServer = function () { ...@@ -191,14 +190,10 @@ exports.createServer = function () {
handler = function (req, res) { handler = function (req, res) {
proxy.proxyRequest(req, res); proxy.proxyRequest(req, res);
} }
if(middleware.length) if(middleware.length) middleware.push(handler)
middleware.push(handler)
} }
if(middleware.length) if(middleware.length) handler = stack(middleware, proxy);
//handler = callback = middleware.shift()
//else if (middleware.length)
handler = callback = stack(middleware, proxy);
if (!handler) { if (!handler) {
// //
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment