Page Contents

Home > @loopback/rest > RestServer > sequence

RestServer.sequence() method

Configure a custom sequence class for handling incoming requests.

Signature:

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

Parameters

Parameter Type Description
value Constructor<SequenceHandler> The sequence to invoke for each incoming request.

Returns:

void

Example

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

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