server actions or route handlers for a 40-endpoint internal dashboard, two devs Routing
Two of us, six weeks, internal ops tool for about 60 staff. Roughly 40 operations: lists with filters, a lot of forms, some bulk actions, a couple of CSV exports.
There is a decent chance we get asked for a thin mobile app next year, but nothing is committed. I keep going back and forth: server actions everywhere is less code today, route handlers are more code today but I do not have to redo anything if the mobile thing happens.
Which one do people regret less at this size?
@awkward_ash · 2mo ago · 2 replies
Split it on the question "will a client I do not control ever need this?"
Content-Disposition.That is maybe 8 route handlers and 32 actions. If mobile happens you write an
/api/v1that calls the same service functions, which is the actual lesson: put the logic in plain functions and let both transports be thin. Then the decision stops being expensive.Reply
Report
@thesis_wrangler · 2mo ago
"Put the logic in plain functions" is the bit I was missing. I was treating the action file as the unit of work rather than a transport.
Reply
Report