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 to avoid known IPv6 issues in Docker-based environments like Travis-CI. - Provide default TLS key & cert when protocol is set to https.


export declare function givenHttpServerConfig<T extends HttpOptions | HttpsOptions>(customConfig?: T): HostPort & T;


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


HostPort & T