Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebResponse

Web Handler implementation of the @akera/api IWebResponse interface it's just a wrapper on top of an express.Response.

Hierarchy

  • WebResponse

Implements

  • any

Index

Constructors

Methods

Constructors

constructor

  • new WebResponse(_response: express.Response): WebResponse
  • akera/api

    webRequest method to stream the response received from the back-end.

    Parameters

    • _response: express.Response

      The express.Response that will be used by

    Returns WebResponse

Methods

cookie

  • cookie(name: string, value: string, options?: akera.ICookieOptions): akera.IWebResponse
  • Set the HTTP cookie on the wrapped express Response.

    Parameters

    • name: string

      The HTTP cookie name.

    • value: string

      The HTTP cookie value.

    • Optional options: akera.ICookieOptions

      Extra HTTP cookie options (domain, expire, etc).

    Returns akera.IWebResponse

end

  • end(data: string | Buffer): akera.IWebResponse
  • Close the wrapped express Response and stream the data received, if any.

    Parameters

    • data: string | Buffer

      Data received from the back-end.

    Returns akera.IWebResponse

send

  • send(data: string | Buffer): akera.IWebResponse
  • Send the data received into the wrapped express Response.

    Parameters

    • data: string | Buffer

      Data received from the back-end.

    Returns akera.IWebResponse

setHeader

  • setHeader(name: any, value: any): akera.IWebResponse
  • Set the HTTP header on the wrapped express Response.

    Parameters

    • name: any

      The header name.

    • value: any

      The header value.

    Returns akera.IWebResponse

status

  • status(code: number): akera.IWebResponse
  • Set the HTTP status code on the wrapped express Response.

    Parameters

    • code: number

      The HTTP status code.

    Returns akera.IWebResponse