@loopback/docs
Version:
Documentation for LoopBack 4
38 lines (24 loc) • 952 B
Markdown
lang: en
title: 'API docs: rest.restserver._requesthandler'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.rest.restserver._requesthandler.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/rest](./rest.md) > [RestServer](./rest.restserver.md) > [\_requestHandler](./rest.restserver._requesthandler.md)
## RestServer.\_requestHandler property
Handle incoming HTTP(S) request by invoking the corresponding Controller method via the configured Sequence.
<b>Signature:</b>
```typescript
protected _requestHandler: HttpRequestListener;
```
## Example
```ts
const app = new Application();
app.component(RestComponent);
// setup controllers, etc.
const restServer = await app.getServer(RestServer);
const httpServer = http.createServer(restServer.requestHandler);
httpServer.listen(3000);
```