Search code examples
javascriptajaxreactjscors

How to allow CORS in react.js?


I'm using Reactjs and using API through AJAX in javascript. How can we resolve this issue? Previously I used CORS tools, but now I need to enable CORS.


Solution

  • Possible repeated question from How to overcome the CORS issue in ReactJS

    CORS works by adding new HTTP headers that allow servers to describe the set of origins that are permitted to read that information using a web browser. This must be configured in the server to allow cross domain.

    You can temporary solve this issue by a chrome plugin called CORS.