All packages
npm package

@pyriter/unrest

Express-style routing for AWS Lambda — without Express.

Version v2.8.0
Weekly 141
License OSS

Installation

$ npm install @pyriter/unrest
$ pnpm add @pyriter/unrest
$ yarn add @pyriter/unrest
$ bun add @pyriter/unrest

Overview

A focused HTTP routing library purpose-built for AWS Lambda + API Gateway / Function URLs. Express-shaped middleware and route handlers, but ~10× smaller and zero adapter overhead.

  • Native API Gateway v1 + v2 event handling
  • Composable middleware chain (auth, logging, error handling)
  • Typed request and response objects
  • No Express, no serverless-http shim

Usage

Handler entrypoint

ts
import { Router } from '@pyriter/unrest';

const router = new Router();

router.get('/users/:id', async (req) => {
  return { user: { id: req.params.id } };
});

router.post('/users', async (req) => {
  return { ok: true, body: req.body };
});

export const handler = router.toLambda();

Keywords

AWS LambdaroutingRESTAPI Gateway