Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

How the API routes should be consumed? #187

Answered by shadowtime2000
borsemayur2 asked this question in Q&A
Discussion options

Is it okay to use axios/fetch to consume the API routes in pages?

You must be logged in to vote

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

Comment options

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.

You must be logged in to vote
3 replies
Comment options

Okay. I think I need a better understanding of SSR and SSG. I'm using API routes for CRUD actions. Thanks

Comment options

It means, using axios to consume API routes makes it Client Side Rendered page. Right?

Comment options

@borsemayur2 So if your using API routes for CRUD actions then its fine to use axios/fetch

Answer selected by shadowtime2000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /