v1.0.0-beta.1 — Now Available

Express-style routing
for AWS Lambda

Build serverless APls with the DX you already love. Familiar routing, chainable middleware, and full TypeScript support - all optimized for Lambda cold starts.

MIT Licensed·Zero dependencies·TypeScript first
handler.ts
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)
< 5KBBundle size
0Config needed
100%TypeScript
< 3msRouting overhead
0GitHub stars
13/wknpm downloads
Features

Everything you need.
Nothing you don't.

A focused toolkit for building production serverless APIs — no bloat, no magic, just clean primitives.

Express-Style Routing

Familiar .get(), .post(), .put(), .delete() API. If you know Express, you already know Zapix.

Chainable Middleware

Compose auth, validation, logging in clean chains. Apply globally or per-route.

TypeScript First

Full type safety with typed handlers, request/response generics, and IDE auto-completion.

Blazing Fast

Minimal overhead on Lambda cold starts. No heavy framework, just a lightweight router.

Zero Dependencies

Ship less code. Zapix is self-contained with no external runtime dependencies.

Error Handling

Global error handlers with customizable responses. Catch, log, and respond gracefully.

Integrations

Deploy the way you want

Zapix drops into the most common AWS serverless workflows with the same handler export.

Single handlerZero config
SL
Serverless FrameworkIntegration target
serverless.yml

Deploy Zapix handlers with your serverless.yml and standard AWS Lambda runtimes.

handler(app)
SST
SSTIntegration target
sst.config.ts

Drop Zapix into SST functions and keep the same handler export in local dev and prod.

handler(app)
SAM
AWS SAMIntegration target
template.yaml

Wire Zapix handlers to SAM template functions with minimal glue.

handler(app)
λ
Raw AWS LambdaIntegration target
index.ts

Use the zapix/aws handler directly in a plain Lambda without any framework.

handler(app)
Developer Experience

Write APIs like it's Express

Same patterns you already know — middleware chains, route params, error handlers — but running on Lambda.

middleware.ts
1// Auth middleware — runs before your handler
2const auth = async (req, res, next) => {
3 const token = req.headers.authorization
4 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 route
13app.post('/users', auth, async (req, res) => {
14 const user = await createUser(req.body)
15 res.status(201).json(user)
16}
routes.ts
1// Full CRUD in one Lambda function
2const app = Zapix()
3 
4// Global middleware
5app.use(cors)
6app.use(logger)
7 
8// Define your routes
9app.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 handler
16app.onError((err, req, res) => {
17 res.status(500).json({ error: err.message })
18}
19 
20export const userHandler = handler(app)
Why Zapix?

Stop writing routing boilerplate

See the difference when you replace raw Lambda handlers with Zapix.

×
Raw Lambda Handler
handler.ts
1export const main = async (event) => {
2 const method = event.requestContext.http.method
3 const path = event.rawPath
4 
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 nesting
11 }
12}
With Zapix
handler.ts
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)
CLI Tool

Scaffold, don't type

The Zapix CLI generates everything — projects, modules, controllers, middleware — so you focus on logic, not boilerplate.

zapix create

Scaffold a new project with TypeScript and your preferred deployment target

zapix generate module

Create organized modules with routes, handlers, and types

zapix generate controller

Add typed controllers with middleware wiring

~/ terminal
$npx zapix create my-api
Creating a new Zapix project in ./my-api
Project created successfully!
$cd my-api
$npx zapix generate module users
Generating users module...
created src/modules/users/controller.ts
created src/modules/users/routes.ts
created src/modules/users/types.ts
Module "users" generated successfully!

Start building in seconds

Install the package and ship your first serverless API today.

Install
$npm install zapix
or scaffold a project
Create
$npx zapix create my-api