-
Notifications
You must be signed in to change notification settings - Fork 13
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
Request for more documentation + question on why /api is being stripped off. #1
Comments
It's a bug. I had fixed it, please update with v0.2.0: npm i http-route-proxy@0.2.0
app.use('/api', proxyServer.connect({
from: 'localhost:3000',
to: 'localhost:3001'
})); |
I tried a) uninstalling and reinstalling and b) installing
Here's my output:
|
When I use remove
Proxy says that it's working:
But when I log
Output:
|
It's my mistake, i should rewrite req.url and req.path otherwise proxy-agent will use the req object that was modified by express directly. It will be fixed at v0.2.1. : ) v0.2.1 is published, using |
Oh, whoops - I misread.
Works great - thanks! |
I'd find more documentation useful. I like that common scenarios are covered with good examples, but I don't see how to branch out from there.
For example, I'm trying to route everything prefaced with
/api
tolocalhost:3001
, and everything else tolocalhost:3002
but can't figure out how to do so.When I do this:
The
/api
part gets stripped off somehow:The text was updated successfully, but these errors were encountered: