
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
- my database attribute stuck in processin...
when i created attributes in collection 3 of those attributes become "processing", and they are not updating, the worst thing is that i cant even delete them s...
- Is Quick Start for function creation wor...
I am trying to create a Node.js function using the Quick Start feature. It fails and tells me that it could not locate the package.json file. Isn't Quick Start ...
- Forever Processing Issue
I encountered an issue when creating attributes in the collections . if you create an attribute of type string for example and choose a size of 200 or 250 or a...
