Closed alstn2468 closed 4 years ago
IMHO, you can't overrule CORS in the browser. But you can ignore it in your own server. I'd make an express.js based server running on localhost which would do the Billboard data fetching and your React app would fetch data from your own localhost API (proxy).
React cross domain issue corrupted
Dependencies
Code
Response
TypeError: Failed to fetch
Access to fetch at 'http://www.billboard.com/charts/hot-100/' from origin 'http://127.0.0.1:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.