#Unable to access function from pages site

3 messages · Page 1 of 1 (latest)

valid pebble
#

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" },
});

exotic flume
#

Sounds like it might be CORS.

Do you see anything in the browser console?

valid pebble