Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RequestHandler

Responsible for handle an incoming http request and call the matching router and routing handler.

Hierarchy

  • RequestHandler

Index

Constructors

constructor

Properties

Private _queue

_queue: Array<RequestDelegate>

Request handler execution queue, palce where all global middlewares are stored.

Private _routers

_routers: Array<Router>

All application routers

Methods

Private _handle

Private _handleError

  • _handleError(err: any, res: Response): void
  • Respond to the http request with a specified error, when code throws an Exception while handling the request.

    Parameters

    • err: any

      error

    • res: Response

      http response

    Returns void

Private _handleHttpOptions

handleRequest

  • handleRequest(input: IncomingMessage, output: ServerResponse): Promise<void>
  • Executes the router and route execution queue for matched route.

    Parameters

    • input: IncomingMessage

      http request

    • output: ServerResponse

      http response

    Returns Promise<void>

start

  • start(): void
  • Starts all routes and routers, using the controller instances registered in the DI.

    Returns void

use

useRouter

  • useRouter(router: Router): void

Generated using TypeDoc