Nitro Server vs Custom Express Integration for Nuxt 3 SSR with Legacy Middleware
28K reputation · 25 Aug 2024, 00:34 UTC
Goal
Determine whether to use Nuxt 3’s built‑in Nitro server or to wrap the application in a custom Express server when the project must continue running existing middleware such as passport‑js and body‑parser.
Constraints
- Legacy middleware must remain functional without rewriting.
- Deployment targets include both traditional Node hosts and edge platforms (Vercel, Cloudflare Workers).
- Bundle size and cold‑start latency are concerns for the production environment.
Given Nitro’s zero‑config, undici‑based server offers faster start‑up and native edge support, while Express provides immediate reuse of the middleware ecosystem but adds manual configuration and a larger server bundle.
Which approach best satisfies the middleware compatibility requirement while meeting the deployment and performance constraints?