8 months ago
How does hosting nextjs app router route handlers work vs hosting on a serverless platform? I'm building my app using a hono/bun server and nextjs frontend and Im' curious if there is any benefit, advantage over nextjs route handlers?
2 Replies
8 months ago
Hey!
Nextjs server route handlers are intended for serverless runtimes, but you can run them on a "serverful" runtimes (like Railway) without any penalties whatsoever in most cases (unless you're relying on edge/cdn cache from Vercel etc.)
A standalone hono/bun server gives you better separation of concerns (no frontend-intermingling-with-backend) and it's scalable on its own. I'd personally recommend this over Next but this is more of a general architecture decision you have to make for your own setup.
Status changed to Awaiting User Response Railway • 8 months ago
8 months ago
Got it. Yeah I was mostly curious. I'm early enough I can go either route. but thinking on this more you can scale backends easier. so sticking to as is.
Status changed to Awaiting Railway Response Railway • 8 months ago
Status changed to Solved chandrika • 8 months ago