Skip to content

Fix CORS permissions to allow the projects to work from new domain #118

@bizmate

Description

@bizmate

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 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions