#SSR API Routes Failed to Parse

1 messages · Page 1 of 1 (latest)

swift sandal
#

hello everyone, I've just strted messing around with Astro and have been trying to build an api route to be consumed by a page. Reading the doc, I put my articles.ts file inside an api folder inside pages. Using curl I am able to get data back, but using fetch /api/articles throws this error:
Failed to parse URL from /api/articles.

Has this happened to others?

hybrid shoal
#

I found this message from @snow patio very insightful #1054915289533395015 message
Otherwise if you still want to do like you're doing currently, you'll need to specify the full url

fetch("http://localhost:3000/api/articles")