@karmaniverous/smoz
v0.2.10
Published
John Galt Services back end.
Readme
SMOZ
Serverless · Middy · OpenAPI 3.1 · Zod
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)
Quick start (from zero)
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/getQuick links
Install
npm i @karmaniverous/smoz zod zod-openapiDev tooling (recommended):
npm i -D typescript typescript-eslint eslint prettier typedoc