
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
- Server Error when Pushing a Function
Get this ambiguous error when trying to push my function, it's TypeScript using NodeJS 18 ``` ? Which functions would you like to push? get-grades (get-grades)...
- Network error when attempting to fetch r...
Hi, I am trying to modify some database data in the console for testing but keep getting this error. I am on the appwrite cloud and have already tried clearing ...
- Having errors migrating to cloud
Project will not migrate compeltely
