GitHub

DaffSsrResponse

import { DaffSsrResponse } from '@daffodil/ssr'

The document response for a server-side render.

interface DaffSsrResponse {
  get(header: string): Array<string> | string
  set(
    name: string
    value: string | string[]
  ): void
  append(
    name: string
    value: string | string[]
  ): void
  status(code: number): void
}

() Methods

get
Array<string> | string

Get the value of a header by name.

Parameters
Parameterheader: string
Description
set
void

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

Parameters
Parametername: string
Description
Parametervalue: string | string[]
Description
append
void

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

Parameters
Parametername: string
Description
Parametervalue: string | string[]
Description
status
void

Set the status code of the response.

Parameters
Parametercode: number
Description