GitHub

DaffSsrExpressResponse

A response that interfaces with the express request.

import { DaffSsrExpressResponse } from '@daffodil/ssr/express'
class DaffSsrExpressResponse implements DaffSsrResponse {
  protected response: Response
  get(header: string): Array<string> | string
  set(
    name: string
    value: string | string[]
  ): void
  append(
    name: string
    value: string | string[]
  ): void
  status(code: number): void
}

Properties

Name Type Description
response Response
get Array<string> | string

Get the value of a header by name.

set void

Set a header to a particular value. Removes all existing headers of this name.

append void

Append a header to the response, preserving the existing headers.

status void

Set the status code of the response.