Page Contents

Home > @loopback/testlab > givenHttpServerConfig

givenHttpServerConfig() function

Create an HTTP-server configuration that works well in test environments. - Ask the operating system to assign a free (ephemeral) port. - Use IPv4 localhost 127.0.0.1 to avoid known IPv6 issues in Docker-based environments like Travis-CI. - Provide default TLS key & cert when protocol is set to https.

Signature:

export declare function givenHttpServerConfig<T extends object>(customConfig?: T & {
    protocol?: string;
}): ConfigRetval<T>;

Parameters

Parameter Type Description
customConfig T & {
protocol?: string;
}
Additional configuration options to apply.

Returns:

ConfigRetval<T>