how to create instance
Unanswered
Weevil parasitoid posted this in #help-forum
Weevil parasitoidOP
how to create instance for server fecth?
8 Replies
Dwarf Hotot
uh just fetch()?
by default all components and pages are rendered on server so fetch is also a server thing now
Weevil parasitoidOP
I don't want to pass the API URL 127.0.0.1:5000/api to fetch
example for client
Dwarf Hotot
well just do api job in the component
server components are rendered in the server using external api calls to fetch data in rsc is dumb
Weevil parasitoidOP
this example normal?
Dwarf Hotot
if its a external api yes if its a nextjs api route just put api route functionality to component