---
lang: en
title: 'API docs: testlab.givenhttpserverconfig'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/strongloop/loopback-next/tree/master/packages/testlab
permalink: /doc/en/lb4/apidocs.testlab.givenhttpserverconfig.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/testlab](./testlab.md) &gt; [givenHttpServerConfig](./testlab.givenhttpserverconfig.md)

## 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 &amp; cert when `protocol` is set to `https`<!-- -->.

<b>Signature:</b>

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

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  customConfig | T | Additional configuration options to apply. |

<b>Returns:</b>

[HostPort](./testlab.hostport.md) &amp; T


