How the API routes should be consumed? #187
Answered
by
shadowtime2000
borsemayur2
asked this question in
Q&A
-
Is it okay to use axios/fetch to consume the API routes in pages? |
Beta Was this translation helpful? Give feedback.
Answered by
shadowtime2000
Mar 11, 2021
Replies: 1 comment 3 replies
-
Really depends. If it is data that is supposed to be available during SSR/SSG ( |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
shadowtime2000
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.