Back

[SOLVED] Request blocked by CORS policy from localhost

  • 0
  • Web
battlesheep123
8 Dec, 2023, 17:00

Hello,

I'm getting the error message Access to XMLHttpRequest at 'https://appwrite.io/v1/account' from origin 'http://localhost:5173' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. when connecting to Appwrite from localhost.

I added the following hostnames in the web platforms of my project:

127.0.0.1 localhost *

None of them works.

Any ideas?

TL;DR
Title: [SOLVED] CORS policy blocking localhost request Solution: Try setting the endpoint to `https://cloud.appwrite.io/v1`
Drake
8 Dec, 2023, 17:02

Can you try setting your endpoint to https://cloud.appwrite.io/v1?

battlesheep123
8 Dec, 2023, 17:02

That actually works! Thanks, man.

Drake
8 Dec, 2023, 17:03

[SOLVED] Request blocked by CORS policy from localhost

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more