Skip to content

Commit 0723d13

Browse files
committed
got it woking for basic example
1 parent 810b69a commit 0723d13

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ function matcher (url, dest) {
1313
// storing them in an array - on each request, if the URL matches one that has
1414
// a function stored for it, the function will be called.
1515
return function (url) {
16-
16+
var m = r(url)
17+
if (!m) {
18+
return;
19+
}
1720
var path = url.slice(m[0].length);
1821
console.log('proxy:', url, '->', dest);
1922
return {url: path, dest: dest};
@@ -50,6 +53,6 @@ module.exports = function (urls) {
5053
return proxy.proxyRequest(req, res, m.dest);
5154
}
5255
}
53-
next() //did not have a rule for this request. fall back to next middleware.
56+
next() //if there wasno matching rule, fall back to next middleware.
5457
}
5558
}

0 commit comments

Comments
 (0)