-
Notifications
You must be signed in to change notification settings - Fork 840
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
Can you define multiple routes? #4
Comments
multiple routes are not yet supported. do you have any thoughts how the function call should look like? I was thinking something like this: |
@chimurai that looks good to me, and is what I tried first, just to see if it would work :) |
I currently don't have the need to proxy to multiple hosts, however it might be a good idea to support this as well, you would need a way to define a route table. Examples here, from some others: |
Interesting idea. I can only think of a vhost-ish setup. |
@wgorder |
In the documentation it says we can use multiple contexts.. But passing the array of the two different ones don't work. In my case, I work with more than one server/API.. Our service calls and servers depend on what module of the application it's on.. In some cases I need to call services across 3 or 4 different contexts.. |
QUOTING FROM NPMJS PAGE.... var proxyMiddleware = require('http-proxy-middleware'); var proxy = proxyMiddleware('/api', {target: 'http://www.example.org'}); // 'proxy' is now ready to be used in a server. context: matches provided context against request-urls' path. Matching requests will be proxied to the target host. Example: '/api' or ['/api', '/ajax'] |
@giohperez could you provide the depencies/devdependencies in your package.json? I'm suspecting you are using an older version. multiple paths support is introduced in v0.2.0 |
Closing this issue. |
Wondering if it possible to define multiple routes to be proxied to the same backend server?
The text was updated successfully, but these errors were encountered: