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'
As per lines
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 foldercurl -o 02-tours/setup/public/tours.json https://www.course-api.com/react-tours-project
and change the url toconst url = 'http://localhost:3000/tours.json'
or for the server owner to allow CORS