Next.js Discord

Discord Forum

Is using NextJS ONLY for building an API a good idea or an overkill?

Unanswered
Polar bear posted this in #help-forum
Open in Discord
Polar bearOP
I am planning to build a very simple api (there will be NO frontend) and just wondering if nextjs api routes are suitable for this purpose (given that I will be deploying on vercel). Or will it be an overkill and should I just use expressJS?

7 Replies

honestly i would probably do this just for the ease of it
if you wanted to seperate in the future it wouldn't be too hard to change the functions to lambdas in another framework
don't take my word for gospel though, i don't know if there are implications at scale or if it even matters
Polar bearOP
yeah. Thats what I am wondering as well. If NextJS even supposed to be used without frontend. But, I removed all frontend related dependencies and its working fine.
Kawakawa
^ kinda agree, it's probably fine if you're really against learning new tech but express is really easy and a good candidate for a simple api. plus lots of people have done it before so if you get stuck you'd have confidence someone else has faced an issue
if you just want vercel, you can use a similar to express api via vercel functions https://vercel.com/docs/functions/runtimes/node-js
Polar bearOP
yeah. thanks. I will probably just switch to expressjs.