Service · Serverless migration
Migrate your Express API to AWS Lambda
Paying for an always-on Node.js server whose traffic is bursty or quiet overnight? I move Express APIs to AWS Lambda and API Gateway incrementally — one route or group of routes at a time — so the old server and the new endpoints run side by side until every route is proven in production. No big-bang rewrite.
What the migration covers
- An audit of the current app — routes, middleware, database connections, background jobs, file uploads and anything that assumes a long-lived process.
- A migration plan per route: wrap first with
serverless-httpwhere that's enough, or split into dedicated per-endpoint functions where it pays off. - Shared code in Lambda Layers — auth helpers, DB access, logging and response formatting — instead of copy-pasting across functions.
- Auth moved to the edge with a Lambda authorizer (or Cognito), so handlers stay small.
- Database connection handling that survives Lambda's concurrency model, reusing connections across invocations.
- Infrastructure as code (Serverless Framework / CloudFormation) and a deploy pipeline, so every route deploys on its own.
How the cutover works
- Put API Gateway in front of the existing server under your custom domain, so nothing changes for clients.
- Move the first low-risk route group to Lambda and verify it in production behind the same domain.
- Repeat route by route, cutting traffic over only after each one is verified — the Express server keeps serving whatever hasn't moved yet.
- Retire the always-on server once the last route is live, and hand over docs and runbooks.
Will it actually be cheaper?
Often, yes — APIs with bursty traffic or long idle periods stop paying for a server that mostly waits. But it depends on your traffic: steady, high-throughput workloads can cost more on Lambda than on a container. Before any code moves, I'll look at your real traffic and give you a straight estimate, including when I think migrating isn't worth it.
Relevant work
100+ endpoint Express app → Lambda
A long-running Express monolith was costing money 24/7 for traffic that was bursty and mostly idle overnight. I broke the endpoints apart into individually deployed Lambda functions behind API Gateway, extracted shared logic into layers and moved deployment to CloudFormation — cutting hosting cost and letting each endpoint scale on its own.
Legacy endpoints migrated at scale
At Sketch to Growth I migrated a large set of legacy endpoints from server-hosted Express to Lambda as part of a backend that has grown to roughly 1,000 Lambda endpoints.
Stack
- Express
- Node.js
- TypeScript
- AWS Lambda
- API Gateway
- serverless-http
- Lambda Layers
- Serverless Framework
- CloudFormation
- Cognito
- RDS
- DynamoDB
FAQ
Do we need to rewrite the app?
No. Most of the business logic moves as-is. Routes can start wrapped with serverless-http and be split into dedicated functions later, only where that's worth it.
Will there be downtime?
The plan is built to avoid it: the existing server keeps running behind the same domain, and traffic moves route by route only after each one is verified.
What about WebSockets, cron jobs and file uploads?
They're planned separately: scheduled work moves to EventBridge rules, uploads move to S3 pre-signed URLs, and long-lived connections get their own design rather than being forced into request/response functions.
How long does a migration take?
It depends on the number of routes and how much the app relies on in-process state. After the audit you get a scoped plan with the route groups in order.
Related services
- AWS Lambda & Serverless — Serverless REST APIs on Lambda and API Gateway in Node.js/TypeScript — new builds, scaling existing setups, and cost and cold-start work.
- Node.js & TypeScript backends — REST APIs, data layers, auth and jobs in Node.js/TypeScript — for product teams and as a backend contractor for agencies.
- Python FastAPI backends — Typed FastAPI REST APIs over MySQL/PostgreSQL, with business rules on the server — plus React frontends when needed.
Tell me what you're building
Send a few lines about the project — what exists today, what you need, and any deadline. I reply within one business day.