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
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...
- Edit ID of an existing collection
Hi there. Is it possible to edit an ID of an existing collection? Right now it looks impossible from AppWrite cloud at least.
- Deploy function not working - 503
Hellon i get this error message, when i try to deploy a new version of a function <html><body><h1>503 Service Unavailable</h1>No server is available to handle...