Next.js Discord

Discord Forum

Next with Express

Unanswered
~/.BeastieNate5 posted this in #help-forum
Open in Discord
I was going to have a project with Next so I could have ssr with react but then use Express for an api but I was told that it’s unnecessary. I understand I can do all that in Next but is it dumb to have Next handle all the routing and data fetching and Express act as a API?

23 Replies

Netherland Dwarf
It would not be efficient
you can do it , but next.js is a fullstack app
It was built to do front end and light backend
@~/.BeastieNate5
Ah ok that makes sense
What if you have a bit more of a intense backend?
Netherland Dwarf
@~/.BeastieNate5
Like what ?
I was thinking that you might want to separate your front end management and back end management because maybe it would keep things more organized. The express backend could be doing all the business logic and then nextjs just fetches that data
Just a separation of concerns
Netherland Dwarf
@~/.BeastieNate5 in some framework yes because they dont support it, or theyre more built for backend
Such as flask
But next.js was built for both.
And it actually makes it more easier to maintain
So for this case next still allows you to seperate the logic
Of the backend and frontend
And still make it readable and easy to maintain .
Next offers auth, middleware and much more.
Ok I see what you mean. its just have seen alot of people separate them
Netherland Dwarf
It depends on your project needs
For some they do it
But like i said it can do a lot of backend that you would normally do with express but simpler.
ok thank you for the info. I'm prob going to try both approaches