Answer the question
In order to leave comments, you need to log in
React app, how to get data from the server in developer mode?
We have an application on our own server. Previously, the frontend was in native js, now we decided to rewrite the frontend in react JS.
I created an application using the basic create-react-app command and started writing, deployed to the server and everything works, but there was a problem:
In developer mode, when I write the application locally, I cannot access the server API, because. cookies are needed there, which are not there if you do not log in. (And it turns out that I can only check the result of the work after building and uploading the code to the server, this is very inconvenient.
Guys, what should I do? Help, please!
Answer the question
In order to leave comments, you need to log in
Specify a hostname for 127.0.0.1 in hosts that matches the cookie domain and open it in a browser
+ you may need to add the host setting in webpack to this
Or you can rewrite the cookie domain through a proxy in webpack and put them on localhost
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question