Next.js Discord

Discord Forum

which is the right way to make my front end communicate with backend?

Answered
Peruvian anchoveta posted this in #help-forum
Open in Discord
Peruvian anchovetaOP
Answered by Yellow-bellied Flycatcher
Use the fetch method to fetch data from your API, check for data loading within docs
View full answer

16 Replies

Yellow-bellied Flycatcher
Those docs are for creating your backend in nextjs
Filipino Venus
By doing fetch calls and not using server side garbage
duh
@Filipino Venus By doing fetch calls and not using server side garbage
Peruvian anchovetaOP
what is "server side garbage"
Filipino Venus
You can do API calls and stuff on the server side and directly pass back html instead of using fetch calls.
@Yellow-bellied Flycatcher Those docs are for creating your backend in nextjs
Peruvian anchovetaOP
alright well is there a doc explaining the connection between backend and frontend?
@Peruvian anchoveta is this better? how is it different?
Filipino Venus
"Its cooler and trendier", but maintaining is a mess
@Peruvian anchoveta alright well is there a doc explaining the connection between backend and frontend?
Yellow-bellied Flycatcher
Use the fetch method to fetch data from your API, check for data loading within docs
Answer
Peruvian anchovetaOP
thank you guys
@Filipino Venus "Its cooler and trendier", but maintaining is a mess
Yellow-bellied Flycatcher
Depends on use case no?
@Yellow-bellied Flycatcher Depends on use case no?
Filipino Venus
From my experience, its just easier to use fetch and maintain.
old habits die hard ig
@Filipino Venus From my experience, its just easier to use fetch and maintain.
Yellow-bellied Flycatcher
I do get the comparison part kinda have the same experience but for small use cases it's kinda good
Filipino Venus
Welp
Peruvian anchovetaOP
i honestly just like the fetch method better it seems more logical