Options
All
  • Public
  • Public/Protected
  • All
Menu
     

Class HTTP_MSG

An class used to define default response-payload HTTP Status-Codes.

Hierarchy

  • HTTP_MSG

Index

Constructors

Accessors

Methods

Constructors

constructor

  • new HTTP_MSG(status?: number, temp?: string, help?: boolean): HTTP_MSG
  • Defines a new HTTP_MSG

    Parameters

    • Default value status: number = 200

      The HTTP Status-Code ([1-5][0-9][0-9]).

    • Default value temp: string = ""

      A sprintf-style template that serves as the message given to the end-user when this Status is triggered. The template can be as simple or complicated as you want, then you can hydrate it with the appropriate values as needed.

    • Default value help: boolean = false

      If true, instructs the Routes namespace to include the API document in the payload when the HTTP-Status is an Error-Code.

    Returns HTTP_MSG

Accessors

status

  • get status(): number
  • The HTTP Status-Code ([1-5][0-9][0-9]).

    Returns number

temp

  • get temp(): string
  • The template that serves as the message given to the end-user when this Status is triggered.

    Returns string

help

  • get help(): boolean
  • If true, instructs the Routes namespace to include the API document in the payload when the HTTP-Status is an Error-Code.

    Returns boolean

Methods

valueOf

  • A plain-object version of this HTTP-MSG

    Returns HTTP_OBJ