
I have hosted an Appwrite backend on a digital ocean droplet. I also have a flutter front-end website that i have hosted on a separate digital ocean droplet within a docker container. When I currently send requests to my appwrite instance I get these errors:
[Error] Origin http://demo.edventures.ai is not allowed by Access-Control-Allow-Origin. Status code: 403 [Error] XMLHttpRequest cannot load http://178.128.196.153/v1/account due to access control checks. [Error] Failed to load resource: Origin http://demo.edventures.ai is not allowed by Access-Control-Allow-Origin. Status code: 403 (account, line 0)
It seems that these are CORS errors. I have been asked to update CORS settings by adding my front-end website address to the list of allowed origins. How can I do this? I do not see any settings inside of the Appwrite console to do this.

In the Overview tab in your project, scroll all the way down to the Integrations section. If you haven't already, add a web platform with the hostname of your flutter app

If it's already been done previously, how can I update it?

You can just click on the platform and update the value of the hostname

Something to keep in mind is that if your app is Flutter Web App, you will need to add a Web platform.
This was an issue that was brought up before, but use this method for now

When I go down to integrations, there is a platforms section that contains our flutter webapp. When I click the flutter webapp the only options i have are "Name" which is currently set to just "edventures alpha" and the delete platform option that contains "edventures alpha" and the ip address below it.

Ah in that case, you might have to delete this platform, and create a new one for Web instead

So no need for the one that's currently there? Just do web app alone?

Yepp. Just a web app will do!

Thanks Safwan! And is there any need to update the appwrite backend in the digital ocean droplet by running "docker-compose down" and "docker-compose up -d" after making these changes? or can I just continue as is?

No need for that! Just add the platform and you should be good to go!

Let me know if you still face issues

It seems to be working, thank you for the help Safwan!

[SOLVED] CORS error in Flutter Web App

does it work if you delete the regular web platform and add a flutter web with the hostname instead of the IP?
Recommended threads
- Transferring self-hosted to cloud: will ...
I'd like to transition over to Appwrite cloud, but want to ensure my users won't be forced to re-login.
- AppwriteException: Project ID not found
I'm getting this error: `Error signing up: AppwriteException: Project with the requested ID could not be found. Please check the value of the X-Appwrite-Project...
- The Processing Loop
I was facing an issue while creating attributes for one of my collections so , is there any fix to this . It's been stuck in processing since 20 minutes. Here i...
