SMOZ is a small, pragmatic toolkit for authoring AWS Lambda handlers with [Middy] and [Zod], then aggregating Serverless functions and hand‑crafted OpenAPI 3.1 paths from a single, schema‑first application definition.
- Keep prod code testable and framework‑agnostic
- HTTP middleware with validation, shaping, errors, CORS, negotiation, and HEAD
- Non‑HTTP flows stay lean (no middleware overhead)
From an empty directory:
npx @karmaniverous/smoz init -i
npx smoz dev -p 3000- The first command scaffolds a new app and installs dependencies (including a local
smozbin). - The second command starts the inline local backend and keeps registers + OpenAPI fresh.
- Open http://localhost:3000/openapi in your browser.
Prefer serverless‑offline?
npx smoz dev -l offline -p 3000Add your first endpoint (avoid clashing with the template’s hello):
npx smoz add rest/foo/get- Overview
- Why smoz?
- Getting started
- 10-minute tour
- HTTP Middleware
- Recipes
- Templates
- CLI
- Contributing
npm i @karmaniverous/smoz zod zod-openapinpm i -D typescript typescript-eslint eslint prettier typedoc