Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EndpointHandler

Handles requests to an endpoint. Third to be executed -- after before-handlers but before after-handlers.

Hierarchy

  • EndpointHandler

Index

Methods

exec

  • exec(func: function): void

withBody

  • Registers a body parsing type. Falls back to the floofball default if not defined.

    Parameters

    • type: ParserType

      The type to parse request bodies as.

    Returns EndpointHandler

    This EndpointHandler, for the sake of chaining.

withQuery

  • Registers a query parameter to be parsed on incoming requests. Throws a 400 if a request with an invalid value is encountered.

    Parameters

    • key: string

      The parameter's key.

    • Optional type: AdapterType

      The type to automatically adapt query parameters to.

    • Optional req: undefined | true | false

      Whether this parameter is required or not.

    Returns EndpointHandler

    This EndpointHandler, for the sake of chaining.

Generated using TypeDoc