Question, any idea why the proxy breaks when using a api url more than two levels deep? "/api/blocks" works whereas "/api/blocks/all" does not. Everything else is the same and api routes work separately.
Tried "/api" and "/api/**" in setupProxy.js to no avail.
Hi Alg, sorry for the delayed answer and thank you for your comment.
This deep routes should work as the other ones. What I recommend to you is to use the proxy config that react supports now.
You can simply put the following line in your package.json file:
"proxy": "localhost:5000"
This should do the trick.
Let me know if that works for you!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great guide, thank you!
Question, any idea why the proxy breaks when using a api url more than two levels deep? "/api/blocks" works whereas "/api/blocks/all" does not. Everything else is the same and api routes work separately.
Tried "/api" and "/api/**" in setupProxy.js to no avail.
Hi Alg, sorry for the delayed answer and thank you for your comment.
This deep routes should work as the other ones. What I recommend to you is to use the proxy config that react supports now.
You can simply put the following line in your package.json file:
"proxy": "localhost:5000"
This should do the trick.
Let me know if that works for you!