Skip to content

Documentation / @super-line/server / Middleware

Type Alias: Middleware<A>

Middleware<A> = (ctx, info, next) => Awaitable<void>

Defined in: index.ts:115

Flat middleware run before request/subscribe handlers. Call next() to proceed, or throw to short-circuit (rejecting the operation). Does not change ctx's type.

Type Parameters

A

A

Parameters

ctx

CtxUnion<A>

info

MiddlewareInfo

next

() => Promise<void>

Returns

Awaitable<void>

Released under the MIT License.