Skip to main content

Interface: Middleware<US>

Defined in: net/server/server.ts:253

A middleware runs before and/or after the selected endpoint. A middleware may either block the request entirely (to enforce permissions, etc) or modify the response after the endpoint finished execution.

Note that all registered middlewares get a chance to run for each request. Execution order follows registration order, just like endpoints.

Type Parameters

Type Parameter
US extends Schema

Properties

PropertyTypeDefined in
didProcess?(services, req, info, resp) => Promise<Response>net/server/server.ts:259
shouldProcess?(services, req, info) => Promise<Response>net/server/server.ts:254