Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bizmate opened this issue Jun 17, 2024 · 3 comments
Open

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

bizmate opened this issue Jun 17, 2024 · 3 comments

Comments

@bizmate
Copy link

bizmate commented Jun 17, 2024

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

@TorasFerdin
Copy link

TorasFerdin commented Jun 19, 2024

I had the same issue but, thankfully, i managed to resolve it thanks to your curl fix, thank you!
I hope this will get fixed for good.

@KhoaLiang
Copy link

hey, thank you!

@AkosBrb
Copy link

AkosBrb commented Aug 19, 2024

God bless you! I struggled with this for days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants