Answer the question
In order to leave comments, you need to log in
Is it possible to run backend and frontend on the same machine without cors error?
Good afternoon!
Faced such a problem.
There is a ready-made backend that runs on localhost:3000.
The task is to prepare a React frontend that will query and display data from the backend.
Since the front is running on a different localhost, the fetch request raises corsError no 'access-control-allow-origin'.
Is there any way to solve this problem without editing the backend?
Answer the question
In order to leave comments, you need to log in
Alternatively, you can use proxy in package.json
Proxying API Requests in Development
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question