type alias Middleware

Middleware function signature — call next() to continue the chain.

const logger: Middleware = (req, _res, next) => {
  console.debug(req.path);
  next();
};

Definition

(
req: Request,
res: Response,
next: () => void
) => void

Usage

import { type Middleware } from "lib/web/index.ts";