Back

[SOLVED] Multiple platforms not using all hostnames for CORS

  • 0
  • Web
  • Cloud
Lapotor
20 Jun, 2023, 22:55

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.

TL;DR
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
20 Jun, 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
21 Jun, 2023, 01:25

no, you can have as many platforms as needed

Lapotor
26 Jun, 2023, 17:21

Ok it checks every dot in a domain. So *.pages.dev don't allow sub.sub.pages.dev to access

Lapotor
26 Jun, 2023, 17:23

βœ… Multiple platforms not using all hostnames for CORS

Drake
26 Jun, 2023, 17:31

[SOLVED] Multiple platforms not using all hostnames for CORS

Roi
26 Sep, 2023, 19:43

Just to be clear, If I am working on a project, I need to create two "web platforms".

  1. *.example.com - for my production (example.com) and testing (test.example.com).
  2. localhost - for my local development.
Drake
26 Sep, 2023, 22:13
  1. You need example.com for example.com and the *.example.com for anything.example.com
  2. You don't need to add localhost.
Roi
27 Sep, 2023, 05:51

So I still need two web platforms ?

D5
27 Sep, 2023, 06:17

Yes

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