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

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

[Home](./index.md) &gt; [@loopback/express](./express.md) &gt; [ExpressServer](./express.expressserver.md)

## ExpressServer class

An Express server that provides middleware composition and injection

<b>Signature:</b>

```typescript
export declare class ExpressServer extends BaseMiddlewareRegistry implements Server 
```

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)(config, parent)](./express.expressserver._constructor_.md) |  | Constructs a new instance of the <code>ExpressServer</code> class |

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [basePath](./express.expressserver.basepath.md) |  | string | Base path to mount middleware |
|  [config](./express.expressserver.config.md) |  | ([HttpOptions](./http-server.httpoptions.md) &amp; { basePath?: string \| undefined; settings?: Record&lt;string, unknown&gt; \| undefined; }) \| ([HttpsOptions](./http-server.httpsoptions.md) &amp; { basePath?: string \| undefined; settings?: Record&lt;string, unknown&gt; \| undefined; }) \| undefined |  |
|  [expressApp](./express.expressserver.expressapp.md) |  | express.Application | Embedded Express application |
|  [httpServer](./express.expressserver.httpserver.md) |  | [HttpServer](./http-server.httpserver.md) | HTTP/HTTPS server |
|  [listening](./express.expressserver.listening.md) |  | boolean | Some of the methods below are copied from RestServer TODO(rfeng): We might want to refactor some methods from RestServer into the base ExpressServer. |
|  [rootUrl](./express.expressserver.rooturl.md) |  | string \| undefined | The root url for the server without the basePath. For example, the value will be 'http://localhost:3000' regardless of the <code>basePath</code>. |
|  [url](./express.expressserver.url.md) |  | string \| undefined | The base url for the server, including the basePath if set. For example, the value will be 'http://localhost:3000/api' if <code>basePath</code> is set to '/api'. |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [getMiddlewareContext(request)](./express.expressserver.getmiddlewarecontext.md) |  | Retrieve the middleware context from the request |
|  [start()](./express.expressserver.start.md) |  |  |
|  [stop()](./express.expressserver.stop.md) |  |  |


