Is this ok to do on a server function?
Unanswered
Blue-throated Hummingbird posted this in #help-forum
Blue-throated HummingbirdOP
Is the following okay to do on a server function, I am new to nextJS and I'm not entirely sure if I can fetch data like this on a server component
3 Replies
joulev
Yes that is completely fine
Blue-throated HummingbirdOP
Alright, so if I wanted to I could move all my API routes to server functions inside the components?
joulev
That’s precisely what you should do to fetch data, yes