-
Notifications
You must be signed in to change notification settings - Fork 880
Doesn't seem to recognize non proxy routes (express) #94
Copy link
Copy link
Closed
Labels
Description
Expected behavior
When setting up an express router, routes not in proxy context are not recognized. IE if filter function returns false, non proxy routes in sub application should be found.
Actual behavior
404 for routes in sub application
Setup
- http-proxy-middleware: 0.17.0
- server: express
- other relevant modules
proxy middleware configuration
var filter = function (pathname, req) {
return pathname.match(new RegExp('^/api'));
};
var apiProxy = proxy(filter, {target: 'http://www.example.org:8000'});server mounting
var sub = new express.Router();
sub.use(proxy);
// main app, mount the sub application
var app = express();
app.use('/sub', sub);other route in sub application
sub.get('/someroute',
function(req, res, next) {
// won't find route
}
);Reactions are currently unavailable