Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ServerRouter

Hierarchy

  • ServerRouter

Index

Constructors

constructor

  • Parameters

    Returns ServerRouter

Properties

app

app: any

logger

logger: LoggerInstance

options

routes

routes: any

Methods

bindMethod

  • bindMethod(method: any, routes: any): boolean
  • Binds all routes registered in the method supplied

    Parameters

    • method: any

      The http method to bind

    • routes: any

      The routes map

    Returns boolean

decoratedRoutes

  • decoratedRoutes(controllers: any): object
  • Prepare the decorated routes for being merged into the routes map.

    Parameters

    • controllers: any

      The controllers map

    Returns object

    • delete: object
    • get: object
    • post: object
    • put: object

init

  • init(): void
  • Returns void

prepareControllerMethods

  • prepareControllerMethods(method: any, ctrl: any): object
  • Prepare the controller methods to being bound.

    Parameters

    • method: any
    • ctrl: any

    Returns object

register

  • register(app?: express.Application): any
  • Binds the controller to the express application or creates a new one.

    Parameters

    • Optional app: express.Application

    Returns any

registerController

  • registerController(routes: any, r: any): any
  • Register the controller defined by the route supplied.

    Parameters

    • routes: any

      The routes map

    • r: any

      The route to register

    Returns any

Static build

  • Build a router using the supplied routes map and options.

    Parameters

    • controllers: any | string

      The map of controller classes to bind to

    • routes: any | string

      The map of route files ot bind to

    • Optional options: ServerRouterOptions

    Returns any

Generated using TypeDoc