You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As also shown in many other issues and SO posts, I try to create a proxy and redirect requests from my frontend (localhost:4200) to my backend (localhost:5001).
I successfully run my application with ng serve --proxy-config src\environments\proxy.conf.json. When I access e.g. http://localhost:4200/assets//api/v1/sites/1, it gets rewritten as expected to http://localhost:5001/api/v1/sites/1. However, when requesting http://localhost:4200/assets//api/v1/vehicles, it does not work. They only obvious difference is that the resource vehicles exists under http://localhost:4200 whereas sites/1 does not. When I delete vehicles, the request gets also rewritten.
Is this the expected behaviour: Only rewrite the request if the resource is not available under the original host?
The text was updated successfully, but these errors were encountered:
We forward that file to the webpack-dev-server proxy functionality, which in turn fowards it to http-proxy-middleware. At first blush it seems to be intended, yes. You can read more about it in https://webpack.js.org/configuration/dev-server/#devserver-proxy.
Bug Report or Feature Request (mark with an
x
)Versions.
As also shown in many other issues and SO posts, I try to create a proxy and redirect requests from my frontend (localhost:4200) to my backend (localhost:5001).
proxy.conf.json
I successfully run my application with
ng serve --proxy-config src\environments\proxy.conf.json
. When I access e.g.http://localhost:4200/assets//api/v1/sites/1
, it gets rewritten as expected tohttp://localhost:5001/api/v1/sites/1
. However, when requestinghttp://localhost:4200/assets//api/v1/vehicles
, it does not work. They only obvious difference is that the resourcevehicles
exists underhttp://localhost:4200
whereassites/1
does not. When I deletevehicles
, the request gets also rewritten.Is this the expected behaviour: Only rewrite the request if the resource is not available under the original host?
The text was updated successfully, but these errors were encountered: