I am trying to develop a React Client that consumes the Frappe REST API but on each request I am getting a CORS error. according to the community forum, I have to edit the Nginx conf to allow CORS requests but I am facing this error on my machine (localhost) and the dev server is not Nginx so how can I allow CORS requests on localhost?
Frappe Framework ERPNEXT: How to enable CORS on localhost
3.7k views Asked by sathouel At
3
There are 3 answers
0
On
I don't think you need to configure CORS, especially during local development. Let's say your React client is running the port 8080 and Frappe server is on 8000. You can proxy all your requests from localhost:8080 to localhost:8000.
In production, you can generate the static assets and put them in the www
folder of the Frappe app.