Rank 1: Thread
I am using appwrite cloud for the first time , and was trying to fetch documents with the help of listDocuments methods but i am getting CORS error in the browser.
const client = new Client();
const databases = new Databases(client);
client.setEndpoint(
"https://cloud.appwrite.io/v1/databases/databaseID/collections/collectionId/documents"
);
client.setProject(appwrite_project_id);
const promise = databases.listDocuments(
databaseId,
colectionId
);
promise
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
This is the code that I am using.
The error i am getting :
