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
To tell the React development server to proxy any unknown requests to your node API server in development, you can add a proxy field to your client package.json, for example:
which will redirect all traffic to node API and not REACT Development URL.
This way, when you fetch('/api/articles') in development, the development server will recognize that it’s not a static asset, and will proxy your request to http://localhost:5000/api/articles as a fallback.
The text was updated successfully, but these errors were encountered:
I did try the proxy option then but was not working for me. But works in my new projects. I am happy to assign this issue to you if you are interested to solve 😀
To tell the React development server to proxy any unknown requests to your node API server in development, you can add a proxy field to your client package.json, for example:
"proxy": "http://localhost:5000"
which will redirect all traffic to node API and not REACT Development URL.
This way, when you fetch('/api/articles') in development, the development server will recognize that it’s not a static asset, and will proxy your request to http://localhost:5000/api/articles as a fallback.
The text was updated successfully, but these errors were encountered: