Back

[SOLVED] Cors Issue

  • 0
  • Web
Soumitra Chakraborty
24 Oct, 2023, 02:56

Hello everyone,

I need one help. I am not able to call appwrite functions using axios, its giving me cors error for localhost. I am calling the api from a React app.

TL;DR
The user is encountering a CORS issue when trying to call appwrite functions using axios in a React app. They are receiving an error stating that the request has been blocked by the CORS policy. A suggestion is given to the user to read up on CORS and how to enable it. There is no clear solution mentioned in the thread.
Drake
24 Oct, 2023, 02:57

You'll need to update your function to allow the origin

Soumitra Chakraborty
24 Oct, 2023, 02:59

Can you please guide me?

Soumitra Chakraborty
24 Oct, 2023, 03:02

step5:1 Access to XMLHttpRequest at 'https://6530d1e603dfbc5254d3.appwrite.global/' from origin 'http://localhost:3000' 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.

Drake
24 Oct, 2023, 03:18

I suggest you read up on CORS and how to enable it

Soumitra Chakraborty
24 Oct, 2023, 03:25

Ok the function ran successfully using appwrite sdk for client

Soumitra Chakraborty
24 Oct, 2023, 03:25

Thanks. I was using axios/fetch

Drake
24 Oct, 2023, 03:50

[SOLVED] Cors Issue

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