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 HttpOptions | HttpsOptions>(customConfig?: T): HostPort & T;

Parameters

Parameter Type Description
customConfig T (Optional) Additional configuration options to apply.

Returns:

HostPort & T