[]previous and next page

ServerFnMiddleware

Middleware of a server function.

Middleware of a server function. Call next() to continue; return its value (or another) to answer; throw an HttpError to reject.

Import#

ts
import type { ServerFnMiddleware } from "@shadow-js/dusk/server";

Signature#

ts
type ServerFnMiddleware = (
  context: ServerFnContext,
  next: () => Promise<unknown>,
) => unknown | Promise<unknown>