-
Notifications
You must be signed in to change notification settings - Fork 853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't seem to recognize non proxy routes (express) #94
Comments
In your filter function you are using a string instead of regex in the This piece of code is also weird:
|
@chimurai you are correct, I did not copy my example and made a few mistakes when typing it in, sorry about that. Still having problems, if the filter function returns false, non proxy routes are not hit. IE, in my example the sub app has a context of sub so if I hit 'http://myserver.com/sub/api', the proxy filter will return true and the request will be proxied. However if I hit 'http://myserver.com/sub/someroute', the filter function returns false as it should, but the request does not go through to the subroute endpoint. |
@newmanw: Could be provide a minimal/small working sample app; showing the problem you described? This will help me debug this issue. |
@chimurai absolutely. https://github.com/newmanw/hpm-sub Proxy works: 'http://localhost:3000/sub/api' |
Thanks for providing the example @newmanw. Think this line is causing the issue: lib/index.js#L39 req.url = req.originalUrl; It is modifying the Need to investigate if this is really causing the issue |
Works as I would expect. Awesome turn around time, thanks so much! |
Just pushed v0.17.1 with the fix. Thanks for reporting the issue and helping out with debugging. Greatly appreciated! |
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
proxy middleware configuration
server mounting
other route in sub application
The text was updated successfully, but these errors were encountered: