Access to XMLHttpRequest at 'https://cloud.appwrite.io/v1/databases/66387c50002eb78ca32f/collections/66387c5d003a16f1ed53/documents?queries%5B0%5D=orderDesc%28%22%24createdAt%22%29' from origin 'https://todo-list-vert-omega-47.vercel.app' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'https://localhost' that is not equal to the supplied origin. I'm getting this error , It working with localhost correctly but i'm want to use with vercel , deployed on vercel with correct URL and project_id , but Idk why its occuring can anyone fix this ?
This
export const AppwriteURL =
import.meta.env.VITE_APPWRITE_URL || "https://cloud.appwrite.io/v1";
export const PORJECT_ID =
import.meta.env.VITE_APPWRITE_DATABASES_ID || "66387c2d00392835a51c";
export const DATABASES_ID =
import.meta.env.VITE_APPWRITE_DATABASES_ID || "66387c50002eb78ca32f";
export const COLLECTION_MESSAGE_ID =
import.meta.env.VITE_APPWRITE_COLLECTION_MESSAGE_ID || "66387c5d003a16f1ed53";
export const client = new Client();
client.setEndpoint(AppwriteURL).setProject(PORJECT_ID);
export const databases = new Databases(client);
``` aapwriteConfig.js file
Github repositories - https://github.com/ankit3354/Todo-List.git
VITE_APPWRITE_URL = "https://cloud.appwrite.io/v1"
VITE_APPWRITE_DATABASES_ID ='66387c50002eb78ca32f'
VITE_APPWRITE_COLLECTION_MESSAGE_ID ='66387c5d003a16f1ed53'```
env file
Recommended threads
- Session not found. Please run appwrite l...
I have encounter an issue with appwrite CLI They asking for a login session but in the doc, it’s mention that only setup client with endpoint / api key is enou...
- SELF HOSTING ISSUE, DATA NOT MIGRATING T...
Hey, devs, I recently tried to migrate my cloud instance to a self hosted version but my data is not transferred fully only the table structure is transferred ...
- No Document ID?
Hi I have a self hosted appwrite. My documents get a document ID but are not visible in the console. I don't know why this happens and how to fix this