Unable to access function from pages site
I was able to get a function building my pages site at /api/reviews and it returns the data I would expect when accessing it directly in the browser. From my basic react project, i'm trying to access it and i'm getting a 404, here is how i'm trying to retrieve it. Is there another way?
const res = await fetch("/api/review/", {
headers: { Accept: "application/json" },
});
or
const res = await fetch("https://domain.com/api/review", {
headers: { Accept: "application/json" },
});
3 Replies
Sounds like it might be CORS.
Do you see anything in the browser console?

when I hit that in the browser it returns the review