http-proxy-middleware does not forward any of the path #657
Unanswered
jacknugent
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Do you have a working |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
yarn why http-proxy-middleware
ORnpm ls http-proxy-middleware
output (mask private folder names with *****)http-proxy-middleware
.Describe the bug (be clear and concise)
I am trying to configure a proxy for my API requests using http-proxy-middleware, which the create react app docs suggest. I set up my proxy like this, in the
setupProxy.js
file:After registering a proxy, I do a simple POST to an endpoint:
The debugger shows this proxy when I run a fetch:
My client gets a 404 error because
https://postman-echo.com
on its own does not match anything on the backend. The path/post
is being left out.This looks similar to this issue but they are not the same (I am using the same syntax as the answer suggests).
Step-by-step reproduction instructions
npm install
thennpm start
Expected behavior (be clear and concise)
According to the http-proxy-middleware docs, I should expect a proxy that does something like this:
The path,
/post
, does not get appended to the proxy request. The target should actually behttps://postman-echo.com/post
.What http-proxy-middleware configuration are you using?
I set up my proxy like this, in the
setupProxy.js
file:What OS/version and node/version are you seeing the problem?
Additional context (optional)
No response
Beta Was this translation helpful? Give feedback.
All reactions