Page Contents

Home > @loopback/rest > RestServer > _requestHandler

RestServer._requestHandler property

Handle incoming HTTP(S) request by invoking the corresponding Controller method via the configured Sequence.

Signature:

protected _requestHandler: HttpRequestListener;

Example

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);