Do You Even Need That Express Custom Server Any More?
summary
Concrete migration steps and working examples that replace an Express custom server with Next API routes: show secure env vars via a root .env, deploy serverless routes to Vercel, and migrate Express server to Next API routes with the same GET/POST/dynamic handlers. Demonstrate MongoDB + Mongoose adjustments (connection reuse and a mongoose connection guard plus try/catch model compilation) and replicate auth using Auth0 with nextjs-auth0 cookie auth. All examples compile and run locally and on Vercel as serverless functions.
AI-written summary · about
chapters (4)
related talks
25mHow to build a GraphQL API with Next.js and Vercel
38mExpress 101
22mNext.js is my main web server for all APIs. And I like it!
18mThe Big Headless CMS Lie
10mEfficiency at scale with Next.js and Supabase
15mBuilding Isomorphic JavaScript Apps Faster with Next.js
26mPreparing Your Node JS Application For Scale
33mVercel + Vue.js
