---
lang: en
title: 'API docs: express.tointerceptor'
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.tointerceptor.html
---

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

[Home](./index.md) &gt; [@loopback/express](./express.md) &gt; [toInterceptor](./express.tointerceptor.md)

## toInterceptor() function

Wrap an express middleware handler function as an interceptor

<b>Signature:</b>

```typescript
export declare function toInterceptor<CTX extends Context = InvocationContext>(firstHandler: ExpressRequestHandler, ...additionalHandlers: ExpressRequestHandler[]): GenericInterceptor<CTX>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  firstHandler | [ExpressRequestHandler](./express.expressrequesthandler.md) | An Express middleware handler |
|  additionalHandlers | [ExpressRequestHandler](./express.expressrequesthandler.md)<!-- -->\[\] | A list of Express middleware handler function |

<b>Returns:</b>

[GenericInterceptor](./context.genericinterceptor.md)<!-- -->&lt;CTX&gt;

## Example


```ts
toInterceptor(fn);
toInterceptor(fn1, fn2, fn3);
```


