Interface MockServerOptions

Source
Expand description

Options for constructing a MockServer or calling createMock().

interface MockServerOptions {
    defaultChunkSize?: number;
    defaultLatency?: number;
    host?: string;
    logLevel?: "error" | "none" | "warning" | "info" | "debug" | "all";
    port?: number;
}

Properties§

§readonly defaultChunkSize?: number

Default characters per SSE text chunk. Individual rules can override this.

defaultValue

0

§readonly defaultLatency?: number

Default ms delay between SSE chunks. Individual rules can override this.

defaultValue

0

§readonly host?: string

Host to bind to. Set to "0.0.0.0" to listen on all interfaces.

defaultValue

"127.0.0.1"

§readonly logLevel?: "error" | "none" | "warning" | "info" | "debug" | "all"

Log verbosity.

defaultValue

"none"

§readonly port?: number

Port to listen on. Pass 0 for a random port (useful in tests).

defaultValue

0