Skip to content

remix/router · Type

View Source

Middleware

Summary

A special kind of request handler that either returns a response or passes control to the next middleware or request handler in the chain.

Signature

type Middleware<transform> = (
  context: RequestContext<any>,
  next: NextFunction,
) => Response | (Promise<Response> & { [contextTransform]?: transform })