---
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 markdown="1">

requestListener


</td><td markdown="1">

[RequestListener](./http-server.requestlistener.md)


</td><td markdown="1">


</td></tr>
<tr><td markdown="1">

serverOptions


</td><td markdown="1">

[HttpServerOptions](./http-server.httpserveroptions.md)


</td><td markdown="1">

_(Optional)_


</td></tr>
</tbody></table>


