import { Client, Account, Databases } from 'appwrite';
const client = new Client();
client.setEndpoint("http://localhost/v1").setProject("6485fa6a1da8f");
export const account = new Account(client);
export const databases = new Databases(client);
The host is localhost
under platform/host
What is your host address ii the browser?
Meaning what is the browser URL when you're runnig this code
CORS error while setting up Appwrite locally for the first time
Would you please also double check the project ID is correct?
,Hi,
I am using refine.dev/next.js with AppWrite. I have just set up the authentication but I am getting "CORS" error. I have checked that the projectID
and API_Endpoint
are correct. I am running my app on localhost:3000
. Also, in the appwrite dashboard, I have set the hostname to *
to test and still it throws the CORS error.
Please share the full exact logs/errors and network logs
Hi, Here is the full error:
Access to XMLHttpRequest at 'https://cloud.appwrite.io/v1/account/sessions/email' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
browser-ponyfill.js:518 POST https://cloud.appwrite.io/v1/account/sessions/email net::ERR_FAILED 401
This happens when I try to log in with my email credentials.
Wait sorry please create a new post rather than reusing an older post
Cool, I will create a new post Thanks
Recommended threads
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Different appwrite IDs are getting expos...
File_URL_FORMAT= https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID] I'm trying to access files in my web app...
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...