FastifyBackend
Defined in: src/http/backend/FastifyBackend.ts:20
Fastify-based default HTTP backend. Leans on Fastify for fast routing,
body parsing (including raw-body support), and its plugin ecosystem.
The directives DSL compiles down to plain Fastify route registrations —
user code never interacts with Fastify types unless they explicitly opt
in via backend.withPlugin(...).
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new FastifyBackend(
opts?):FastifyBackend
Defined in: src/http/backend/FastifyBackend.ts:25
Parameters
Section titled “Parameters”object = ...
Returns
Section titled “Returns”FastifyBackend
Properties
Section titled “Properties”
readonlyname:"fastify"='fastify'
Defined in: src/http/backend/FastifyBackend.ts:21
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”listen()
Section titled “listen()”listen(
host,port):Promise<ServerBinding>
Defined in: src/http/backend/FastifyBackend.ts:76
Start listening. Returns a ServerBinding with the actual bound port.
Parameters
Section titled “Parameters”string
number
Returns
Section titled “Returns”Promise<ServerBinding>
Implementation of
Section titled “Implementation of”registerRoute()
Section titled “registerRoute()”registerRoute(
route):void
Defined in: src/http/backend/FastifyBackend.ts:43
Register all routes before listen is called. Duplicate paths must be rejected.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”HttpServerBackend.registerRoute
setErrorHandler()
Section titled “setErrorHandler()”setErrorHandler(
handler):void
Defined in: src/http/backend/FastifyBackend.ts:68
Optionally register a global error handler.
Parameters
Section titled “Parameters”handler
Section titled “handler”(err, req) => HttpResponse | Promise<HttpResponse>
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”HttpServerBackend.setErrorHandler
setNotFound()
Section titled “setNotFound()”setNotFound(
handler):void
Defined in: src/http/backend/FastifyBackend.ts:60
Optionally register a catch-all not-found handler.
Parameters
Section titled “Parameters”handler
Section titled “handler”(req) => HttpResponse | Promise<HttpResponse>
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”withPlugin()
Section titled “withPlugin()”withPlugin(
plugin,options?):Promise<void>
Defined in: src/http/backend/FastifyBackend.ts:39
Escape hatch: register a native Fastify plugin (e.g. @fastify/cors).
Parameters
Section titled “Parameters”plugin
Section titled “plugin”unknown
options?
Section titled “options?”object
Returns
Section titled “Returns”Promise<void>