Options
All
  • Public
  • Public/Protected
  • All
Menu

ts-framework (v2.7.2)

Index

Type aliases

Filter

Filter: function

Type declaration

    • (req: BaseRequest, res: BaseResponse, next: Function): any | Promise<any>
    • Parameters

      Returns any | Promise<any>

HttpCode

Route

Route: function

Type declaration

    • (req: BaseRequest, res: BaseResponse): any | Promise<any>
    • Parameters

      Returns any | Promise<any>

RouteDefs

RouteDefs: object

Type declaration

  • controller: string | Route
  • Optional filters?: (string | function)[]

Variables

Const BASE_CTRLS_PATH

BASE_CTRLS_PATH: string = path.join(__dirname, ctrl_path)

Const BASE_FILTERS_PATH

BASE_FILTERS_PATH: string = path.join(__dirname, filter_path)

Const Delete

Delete: Function = routeDecoratorFactory("delete")

The @Delete route decorator.

type

{Function}

param

The route to be assigned to the decorated method.

param

The filters to be called before the decorated method.

Const Get

Get: Function = routeDecoratorFactory("get")

The @Get route decorator.

type

{Function}

param

The route to be assigned to the decorated method.

param

The filters to be called before the decorated method.

Const Post

Post: Function = routeDecoratorFactory("post")

The @Post route decorator.

type

{Function}

param

The route to be assigned to the decorated method.

param

The filters to be called before the decorated method.

Const Put

Put: Function = routeDecoratorFactory("put")

The @Put route decorator.

type

{Function}

param

The route to be assigned to the decorated method.

param

The filters to be called before the decorated method.

Const STACK_PROPERTY_NAME

STACK_PROPERTY_NAME: "stack" = "stack"

Const ctrl_path

ctrl_path: "../../../api/controllers" = "../../../api/controllers"

Const filter_path

filter_path: "../../../api/filters" = "../../../api/filters"

Functions

Const Controller

  • Controller(route?: string, filters?: Function[]): controllerDecorator
  • The @Controller decorator.

    Parameters

    • Optional route: string

      The route to be assigned to all methods of decorated class.

    • Default value filters: Function[] = []

      The filters to be called before all methods of decorated class.

    Returns controllerDecorator

_stripStacksInternal

  • _stripStacksInternal(obj: any, clone: boolean): any

Const asyncMiddleware

  • asyncMiddleware(functions: Function | Function[]): (Anonymous function)[]

legacyParams

  • legacyParams(req: Request, res: Response, next: Function): void

Const routeDecoratorFactory

  • routeDecoratorFactory(method: string): Function

stripStacks

  • stripStacks<T>(obj: T): T
  • Recursively traverses an object and removes all stack properties in-place.

    Type parameters

    • T: any

    Parameters

    • obj: T

      The error or object to be stripped of stacks

    Returns T