@lucid-softworks/http-middleware
v0.1.0
Published
Composable onion-style middleware for Web API HTTP handlers.
Downloads
177
Maintainers
Readme
@lucid-softworks/http-middleware
Onion-style middleware composition for Web API handlers.
import { composeHttpMiddleware } from "@lucid-softworks/http-middleware";
const handler = composeHttpMiddleware(
[async (_request, _context, next) => next()],
() => new Response("ok"),
);Layers run in declaration order before next() and unwind in reverse order.
Calling the same next() more than once is rejected.
