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
- Free plan Usage
I using a free plan with one organization. I have three projects but on the free plan I should be able to have 2 projects running But in my case only 1 out of ...
- SPA Not working
So I'm using vite/react, which is spa, and it used to work before, but now whenever I go to any route except the root it shows appwrites 404 page, instead of us...
- Get Started - Web is broken
Trying to complete the get started tasks since the "66%" was finally getting to me, and clicked on "web", was met with: ``` Uncaught TypeError: Cannot read prop...