Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

@sms/host-fastify

Interfaces

FastifyHostOptions

Defined in: packages/drivers/host/fastify/src/index.ts:5

Properties

app?
optional app?: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, FastifyBaseLogger, FastifyTypeProviderDefault>;

Defined in: packages/drivers/host/fastify/src/index.ts:7

Mount into an existing app instead of creating one (your routes/auth/plugins keep working beside it).

host?
optional host?: string;

Defined in: packages/drivers/host/fastify/src/index.ts:9

port?
optional port?: number;

Defined in: packages/drivers/host/fastify/src/index.ts:8

prefix?
optional prefix?: string;

Defined in: packages/drivers/host/fastify/src/index.ts:11

URL prefix to mount under, e.g. /sms. Default: everything not matched by your own routes.

Functions

createFastifyHost()

function createFastifyHost(opts?): Host;

Defined in: packages/drivers/host/fastify/src/index.ts:45

Parameters

ParameterType
optsFastifyHostOptions

Returns

Host


registerHandler()

function registerHandler(
   app, 
   handler, 
   prefix?
): Promise<void>;

Defined in: packages/drivers/host/fastify/src/index.ts:18

Register the handler as a catch-all under prefix, inside an encapsulated plugin scope so that the raw body handling does not leak into your own routes. The baseline’s content-type handling stays authoritative.

Parameters

ParameterTypeDefault value
appFastifyInstanceundefined
handlerRequestHandlerundefined
prefixstring''

Returns

Promise<void>