Is it correct that if I create multiple platforms with different hostnames, only one of the hostnames is used for CORS and only one project ID is used? Or is there another way to do that?
Currently, I'm using one platform for development and have localhost set as the hostname, and I also have cloudflare pages with *.pages.dev set as the hostname. But currently, CORS is only set for localhost.
Summary
The user was having an issue with CORS (Cross-Origin Resource Sharing) and wanted to use multiple hostnames for different platforms. They currently had one platform set up for development with localhost as the hostname, and another platform using `*.pages.dev` hostname for Cloudflare pages. However, CORS was only working for localhost. The issue has been solved, and it was clarified that Appwrite allows CORS for any of the platforms. The solution is to create multiple platforms with different hostnames, and Appwrite will handle CORS dynamically within the PHP code for each platform.
Binyamin
Jun 20, 2023, 23:13
You can create as many platform as you want.
The cors is being handle dynamically within the PHP code, which means Appwrite will allow cors for any of your platforms.
So, when you'll access it from localhost Appwrite will allow localhost, and when you'll access it from other allowed platform Appwrite will allow the cors for that host.
Drake
Jun 21, 2023, 01:25
no, you can have as many platforms as needed
Lapotor
Web Developer
Jun 26, 2023, 17:21
Ok it checks every dot in a domain.
So *.pages.dev don't allow sub.sub.pages.dev to access
Lapotor
Web Developer
Jun 26, 2023, 17:23
✅ Multiple platforms not using all hostnames for CORS
Drake
Jun 26, 2023, 17:31
[SOLVED] Multiple platforms not using all hostnames for CORS
Roi
Sep 26, 2023, 19:43
Just to be clear,
If I am working on a project, I need to create two "web platforms".
*.example.com - for my production (example.com) and testing (test.example.com).
localhost - for my local development.
Drake
Sep 26, 2023, 22:13
You need example.com for example.com and the *.example.com for anything.example.com