Options
All
  • Public
  • Public/Protected
  • All
Menu

External module root

Index

Type aliases

InputMapper

InputMapper: function

An input mapper function that receives the request from expressjs, and maps it to an object that can be processed by the handler.

param

The expressjs request object.

returns

An object that is passed to the handler function for processing.

Type declaration

    • (req: Request): __type
    • Parameters

      • req: Request

      Returns __type

OutputMapper

OutputMapper: function

An output mapper function that takes the output from the handler, and turns it into an HTTP response.

param

The output from the handler

param

The expressjs response object

param

The expressjs next function that can be used to pass control to the next handler in expressjs' handler chain. This is typically used to pass an error down to an error handler routine.

Type declaration

    • (data: object, res: Response, next: NextFunction): any | Promise
    • Parameters

      • data: object
        • [prop: string]: any
      • res: Response
      • next: NextFunction

      Returns any | Promise

RequestHandler

RequestHandler: function

Request processor function that accepts an input object, processes it, and returns the result. The result can be immediate or can be a promise to allow for asynchronous processing.

param

A parsed input object that can be handled by the handler

param

A context object that contains metadata about the current execution. This object is reserved for future enhancements

param

An extended properties object that includes references to useful entities such as loggers, config objects, etc.

returns

A promise or object that is the result of processing the request. If a promise is returned, the handler will wait for the promise to be fulfilled before proceeding.

Type declaration

Functions

buildRoutes

  • Builds routes for a specific router based on delcarative route definitions.

    Parameters

    • routes: IRouteDefinition[]

      Route definitions for the routes that need to be mounted on the router.

    • Default value router: any = Router()

      An optional expressjs router object on to which the routes will be mounted. If omitted, a new router will be created and used.

    Returns Router

    The configured router object, with the specified routes mounted on to it.

Generated using TypeDoc