Skip to content

ServeStartHook

type ServeStartHook = (kind) => void | Promise<void>;

Defined in: src/types.ts:54

Optional lifecycle hook fired once per process before the first dispatched request.

For the stdio server, fires inside VgiRpcServer.run() before the first read. For HTTP, fires lazily on the first request handled (fork-safe for pre-fork servers).

If the hook raises, the server logs the exception and propagates it, leaving the bind state unset so the next attempt re-fires the hook rather than silently skipping it.

ParameterType
kindTransportKind

void | Promise<void>