---
lang: en
title: 'API docs: express.expressserver.getmiddlewarecontext'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/express
permalink: /doc/en/lb4/apidocs.express.expressserver.getmiddlewarecontext.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) &gt; [getMiddlewareContext](./express.expressserver.getmiddlewarecontext.md)

## ExpressServer.getMiddlewareContext() method

Retrieve the middleware context from the request

<b>Signature:</b>

```typescript
getMiddlewareContext(request: Request): MiddlewareContext | undefined;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  request | Request | Request object |

<b>Returns:</b>

[MiddlewareContext](./express.middlewarecontext.md) \| undefined


