Enable CORS in a React App

This situation applies whenever a front-end web app hosted on different domain compared to backend server, we have to deal with browser’s Same Origin policy or CORS issues. Typically you see this issue in your local environment, where in the front-end web app is served on a different port compared to backend api.

One way to by-pass CORS is via adding proxy to package.json as shown in below code.