Build serverless APls with the DX you already love. Familiar routing, chainable middleware, and full TypeScript support - all optimized for Lambda cold starts.
1import { Zapix } from 'zapix'2import { handler } from 'zapix/aws'3 4const app = Zapix()5 6app.get('/users', async (req, res) => {7 const users = await getUsers()8 res.json(users)9})10 11export const main = handler(app)A focused toolkit for building production serverless APIs — no bloat, no magic, just clean primitives.
Familiar .get(), .post(), .put(), .delete() API. If you know Express, you already know Zapix.
Compose auth, validation, logging in clean chains. Apply globally or per-route.
Full type safety with typed handlers, request/response generics, and IDE auto-completion.
Minimal overhead on Lambda cold starts. No heavy framework, just a lightweight router.
Ship less code. Zapix is self-contained with no external runtime dependencies.
Global error handlers with customizable responses. Catch, log, and respond gracefully.
Zapix drops into the most common AWS serverless workflows with the same handler export.
Deploy Zapix handlers with your serverless.yml and standard AWS Lambda runtimes.
Drop Zapix into SST functions and keep the same handler export in local dev and prod.
Wire Zapix handlers to SAM template functions with minimal glue.
Use the zapix/aws handler directly in a plain Lambda without any framework.
Same patterns you already know — middleware chains, route params, error handlers — but running on Lambda.
1// Auth middleware — runs before your handler2const auth = async (req, res, next) => {3 const token = req.headers.authorization4 if (!token) {5 return res.status(401).json({6 error: 'Unauthorized'7 })}8 req.user = verify(token)9 next()10}11 12// Chain it on any route13app.post('/users', auth, async (req, res) => {14 const user = await createUser(req.body)15 res.status(201).json(user)16}1// Full CRUD in one Lambda function2const app = Zapix()3 4// Global middleware5app.use(cors)6app.use(logger)7 8// Define your routes9app.get('/users', listUsers)10app.get('/users/:id', getUser)11app.post('/users', auth, createUser)12app.put('/users/:id', auth, updateUser)13app.delete('/users/:id', auth, deleteUser)14 15// Catch-all error handler16app.onError((err, req, res) => {17 res.status(500).json({ error: err.message })18}19 20export const userHandler = handler(app)See the difference when you replace raw Lambda handlers with Zapix.
1export const main = async (event) => {2 const method = event.requestContext.http.method3 const path = event.rawPath4 5 if (method === 'GET' && path === '/users') {6 const users = await getUsers()7 return { statusCode: 200,8 body: JSON.stringify(users) }9 } else if (method === 'POST') {10 // ...more nesting11 }12}1import { Zapix } from 'zapix'2import { handler } from 'zapix/aws'3 4const app = Zapix()5 6app.get('/users', async (req, res) => {7 res.json(await getUsers())8})9 10app.post('/users', auth, createUser)11 12export const main = handler(app)The Zapix CLI generates everything — projects, modules, controllers, middleware — so you focus on logic, not boilerplate.
zapix createScaffold a new project with TypeScript and your preferred deployment target
zapix generate moduleCreate organized modules with routes, handlers, and types
zapix generate controllerAdd typed controllers with middleware wiring
Install the package and ship your first serverless API today.