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
- Creating A User Account
I have a simple form component that is expected to create a new user using the the ###firstName, ###lastName, ###username, and ###password from a react-hook-for...
- Custom templates for OTP messages:
Is there an option available for custom templates for OTP messages? Receiving OTPs from different domain names causes conflicts and reduces the chances of succe...
- Project blocked due to cloud functions
Two of my projects are blocked when using functions Code : import { Client, Account ,Databases} from 'node-appwrite'; // This Appwrite function will be execu...