taxum
    Preparing search index...

    Type Alias ServeConfig

    Configuration options for starting a server.

    type ServeConfig = {
        abortSignal?: AbortSignal;
        catchCtrlC?: boolean;
        hostname?: number;
        onListen?: (address: AddressInfo) => void;
        port?: number;
        shutdownTimeout?: number;
        trustProxy?: boolean;
        unrefOnStart?: boolean;
    }
    Index

    Properties

    abortSignal?: AbortSignal

    Signal to shut down the server.

    catchCtrlC?: boolean

    Catches CTRL+C and shuts down the server gracefully.

    hostname?: number

    Hostname to bind the server to.

    Defaults to not specific binding.

    onListen?: (address: AddressInfo) => void

    Called once the server started listening.

    port?: number

    Port to run the server on.

    Defaults to random available port.

    shutdownTimeout?: number

    Maximum time (in milliseconds) to wait before returning.

    This will unref the server once the timeout expired and return early. The server will still be open until your program exits.

    trustProxy?: boolean

    Whether to trust proxy headers.

    When set to true, forwarded-for-* headers will be considered.

    unrefOnStart?: boolean

    Starts the server in unrefed mode.

    This is primarily useful in test environments so that an unclosed server doesn't prevent your tests from existing.