Commit 0723d13f authored by Dominic Tarr's avatar Dominic Tarr

got it woking for basic example

parent 810b69a3
......@@ -13,7 +13,10 @@ function matcher (url, dest) {
// storing them in an array - on each request, if the URL matches one that has
// a function stored for it, the function will be called.
return function (url) {
var m = r(url)
if (!m) {
return;
}
var path = url.slice(m[0].length);
console.log('proxy:', url, '->', dest);
return {url: path, dest: dest};
......@@ -50,6 +53,6 @@ module.exports = function (urls) {
return proxy.proxyRequest(req, res, m.dest);
}
}
next() //did not have a rule for this request. fall back to next middleware.
next() //if there wasno matching rule, fall back to next middleware.
}
}
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