Register an additional content type handler for content negotiation. JSON is registered by default.
Returns the authentication configuration, or null if
useAuthentication() has not been called.
Returns a snapshot of all registered endpoints. Useful for generating OpenAPI specs or other documentation.
Returns a snapshot of all registered WebSocket subscription endpoints.
Consumed by @cleverbrush/server-openapi to emit the AsyncAPI spec.
Returns a snapshot of all registered webhook definitions.
Consumed by @cleverbrush/server-openapi to emit the webhooks map.
Register an endpoint and its handler.
An EndpointBuilder instance (e.g. from endpoint.get(...)).
The typed handler function.
Optionaloptions: { middlewares?: Middleware[] }Optional per-endpoint middleware.
Register all endpoints from a HandlerMapping created by
mapHandlers. This is the bulk equivalent of calling
.handle() for each endpoint individually.
The mapping produced by mapHandlers(endpoints, handlers).
Configure the DI service collection.
Receives the ServiceCollection for registrations.
Add a global middleware that runs for every request. Middleware is executed in the order it is added.
Enable authentication with one or more schemes.
Registers a global middleware that authenticates every request and
sets ctx.principal.
Enable authorization enforcement.
Registers a global middleware that checks endpoint authorize()
metadata against the authenticated principal.
Must be called after useAuthentication().
Optionalconfig: AuthorizationConfigEnable the server-side request batching endpoint.
Once enabled, the server accepts POST <path> (default /__batch)
containing an array of sub-requests and processes each one through the
full middleware and handler pipeline, returning an array of
sub-responses in a single HTTP reply.
Pair this with the batching() middleware from @cleverbrush/client/batching
on the client side.
ServerBatchingOptions (all fields optional).
Register a webhook definition.
Webhooks are recorded for OpenAPI spec generation only — they are not served as HTTP routes by the runtime server.
A WebhookDefinition created with defineWebhook.
Enable the GET /health endpoint that returns { ok: true } (200).
Useful for load balancer and container readiness probes.
The path is available as HEALTHCHECK_PATH.
Fluent builder for constructing and starting an HTTP server.
Example