Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • RouteBuilder

Implemented by

Index

Methods

handler

method

  • method(method: string): this

path

  • path(path: string | RegExp): this

postProcessor

serializers

  • serializers(serializers: {}): this
  • Match requests for clients than can accept one of the given mime-types and use the given serializer on the response body. The serializer will be called with the body if the handler returns a response. The serializer must return a string or Buffer, or Promise of such.

    eg:

    serializers({
     "application/json": cassava.serializers.jsonSerializer,
     "text/plain": body => body.toString()
    })

    Parameters

    • serializers: {}

      a map of mime-type to serializer function

      • [mimeType: string]: (body: any) => Promise<string | Buffer> | string | Buffer
          • (body: any): Promise<string | Buffer> | string | Buffer
          • Parameters

            • body: any

            Returns Promise<string | Buffer> | string | Buffer

    Returns this

Generated using TypeDoc