Fetching data in server Component

Is there a way I can fetch data from my api generated in my api routes in server Component rather than writing the route handling logic in my server Component
1 Reply
JulieCezar
JulieCezar14mo ago
Did you just try fetching it normally? Because technically yes you can... but I would not recommend... If you want to do something like that maybe create functions which you can call both in the api and in server components - like GetUserById(id) - or just use client components
Want results from more Discord servers?
Add your server