-
Notifications
You must be signed in to change notification settings - Fork 166
How the API routes should be consumed? #187
-
Is it okay to use axios/fetch to consume the API routes in pages?
Beta Was this translation helpful? Give feedback.
All reactions
Really depends. If it is data that is supposed to be available during SSR/SSG (useDeno) then you shouldn't be doing that. You should instead then be writing the code of the API route inside the page. If it is something that is specifically not meant to be prerendered, then yeah it's pretty much fine.
Replies: 1 comment 3 replies
-
Really depends. If it is data that is supposed to be available during SSR/SSG (useDeno) then you shouldn't be doing that. You should instead then be writing the code of the API route inside the page. If it is something that is specifically not meant to be prerendered, then yeah it's pretty much fine.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Okay. I think I need a better understanding of SSR and SSG. I'm using API routes for CRUD actions. Thanks
Beta Was this translation helpful? Give feedback.
All reactions
-
It means, using axios to consume API routes makes it Client Side Rendered page. Right?
Beta Was this translation helpful? Give feedback.
All reactions
-
@borsemayur2 So if your using API routes for CRUD actions then its fine to use axios/fetch
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1