async function getData() { const url = "https://6798f32eae97aea2944b.appwrite.global/"; try { const response = await fetch(url); if (!response.ok) { throw new Error(Response status: ${response.status}); }
const json = await response.json();
console.log(json);
} catch (error) { console.error(error.message); Â } }
getData();
gives me the error attached in photo
Could you try adding this to your function response
return res.json({
message: "test",
}, 200, {
"Access-Control-Allow-Origin": "*",
})
make that first item whatever your actual return is, but add the status code and the last object is the headers.
Recommended threads
- I'm getting error Invalid `url` param: I...
``` 2025-10-26T12:52:02.292Z [error] AppwriteException: Invalid `url` param: Invalid URI. Register your new client (vercel.com) as a new Web platform on your pr...
- 🚨 Access Restricted Despite Active Cred...
Hello Appwrite Support Team, My organization “Dreamo World Entertainment” currently shows an “Access Restricted” warning due to unpaid invoices. However, my bi...
- Deploy tanstack-start on site
- I am trying to deploy my project build with tanstack-start on site. - issue i am facing is appwrite doesnt provide start command option so i can run 'npm run ...