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

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

[Home](./index.md) &gt; [@loopback/http-server](./http-server.md) &gt; [HttpServer](./http-server.httpserver.md) &gt; [(constructor)](./http-server.httpserver._constructor_.md)

## HttpServer.(constructor)

Constructs a new instance of the `HttpServer` class

**Signature:**

```typescript
constructor(requestListener: RequestListener, serverOptions?: HttpServerOptions);
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

requestListener


</td><td>

[RequestListener](./http-server.requestlistener.md)


</td><td>


</td></tr>
<tr><td>

serverOptions


</td><td>

[HttpServerOptions](./http-server.httpserveroptions.md)


</td><td>

_(Optional)_


</td></tr>
</tbody></table>


