ssr calls to api do not work
Hi all,
I am trying to get some data from my Stapi CMS through the API but I am getting an error.
in my
useGetData.ts
composable I am making a call to the server/api/get-data
. I am getting back a 500 error [GET] "http://localhost:1337/api/hello-world?locale=es-ES&populate=*": <no response> fetch failed
.
Calling the api from postman works ok. the api key and endpoints are correct. It is worth mentioning that if I change the enpoint from the local CMS to the one on the server everything works ok.
Does the server/api
have issues when calling APIs that run locally?
useGetData.ts
server/api/get-data
2 Replies
it looks like you're making a call to
/api/strapi/retrieve-data
and not /api/get-data
ahh sorry that was a typo. i found what the issue was
the issue was the cms was running under windows and the project in wsl