---
lang: en
title: 'API docs: rest.restserver.sequence'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.rest.restserver.sequence.html
---

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

[Home](./index.md) &gt; [@loopback/rest](./rest.md) &gt; [RestServer](./rest.restserver.md) &gt; [sequence](./rest.restserver.sequence.md)

## RestServer.sequence() method

Configure a custom sequence class for handling incoming requests.

<b>Signature:</b>

```typescript
sequence(value: Constructor<SequenceHandler>): void;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  value | <code>Constructor&lt;SequenceHandler&gt;</code> | The sequence to invoke for each incoming request. |

<b>Returns:</b>

`void`

## Example


```ts
class MySequence implements SequenceHandler {
  constructor(
    @inject('send) public send: Send)) {
  }

  public async handle({response}: RequestContext) {
    send(response, 'hello world');
  }
}

```


