-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Open
Description
As per lines
- https://github.com/john-smilga/react-projects/blob/master/02-tours/final/src/App.js#L20
- https://github.com/john-smilga/react-projects/blob/master/06-tabs/setup/src/App.js#L5
- https://github.com/john-smilga/react-projects/blob/master/14-cart/setup/src/context.js#L6
Currently the domain does not allow CORS requests as shown here
Access to fetch at 'https://course-api.com/react-tours-project' from origin 'http://localhost: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.
The alternative is to curl the file and serve it from the local public folder
curl -o 02-tours/setup/public/tours.json https://www.course-api.com/react-tours-project
and change the url to const url = 'http://localhost:3000/tours.json'
or for the server owner to allow CORS
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels