rest-vir - v2.2.0
    Preparing search index...

    Type Alias StartApiServerOutput

    Output of startApiServer.

    type StartApiServerOutput = {
        cluster?: ClusterManager;
        host: string;
        kill: (this: void) => MaybePromise<void>;
        port: number;
        server?: FastifyInstance;
        worker?: WorkerRunner;
    }
    Index

    Properties

    cluster?: ClusterManager

    The ClusterManager for all the spawned server workers. This is populated when the server is run with a multiple threads (when options.workerCount > 1). It will only be populated for the primary thread.

    host: string

    The host that the server was attached to. (This is simply passed directly from the user options, merged with the default.)

    kill: (this: void) => MaybePromise<void>

    Kill the service even if it's using multiple workers. Returns a promise that resolves once Fastify (and its registered plugins) finish their onClose hooks. Including @fastify/websocket's teardown. So in-flight requests and WebSocket connections drain cleanly. Always await this in production shutdown paths.

    port: number

    The port that the server actually started on. This depends on the options given to startApiServer.

    server?: FastifyInstance

    The instantiated and running fastify instance. This is populated when the server is run on only a single thread (when options.workerCount is 1).

    worker?: WorkerRunner

    The WorkerRunner for the current worker. This is populated when the server is run with a multiple threads (when options.workerCount > 1). It will only be populated for non-primary threads.