Link Search Menu Expand Document

index overview

Added in v0.1.0


Table of contents


Model

ConnectConnection (class)

Signature

export declare class ConnectConnection<S> {
  constructor(
    readonly req: IncomingMessage,
    readonly res: ServerResponse,
    readonly actions: LL.List<Action> = LL.nil,
    readonly ended: boolean = false
  )
}

Added in v0.1.0

chain (method)

Signature

public chain<T>(action: Action, ended = false): ConnectConnection<T>

Added in v0.1.0

getRequest (method)

Signature

public getRequest(): IncomingMessage

Added in v0.1.0

getBody (method)

Signature

public getBody(): unknown

Added in v0.1.0

getHeader (method)

Signature

public getHeader(name: string): unknown

Added in v0.1.0

getParams (method)

connect doesn’t have a router, so this will always return undefined. For a type safe router, see fp-ts-routing.

Signature

public getParams(): unknown

Added in v0.1.0

getQuery (method)

Signature

public getQuery(): unknown

Added in v0.1.0

getOriginalUrl (method)

Signature

public getOriginalUrl(): string

Added in v0.1.0

getMethod (method)

Signature

public getMethod(): string

Added in v0.1.0

setCookie (method)

Not implemented.

Signature

public setCookie(
    name: string,
    value: string,
    options: H.CookieOptions,
  ): ConnectConnection<H.HeadersOpen>

Added in v0.1.0

clearCookie (method)

Not implemented.

Signature

public clearCookie(
    name: string,
    options: H.CookieOptions,
  ): ConnectConnection<H.HeadersOpen>

Added in v0.1.0

setHeader (method)

Signature

public setHeader(
    name: string,
    value: string,
  ): ConnectConnection<H.HeadersOpen>

Added in v0.1.0

setStatus (method)

Signature

public setStatus(status: H.Status): ConnectConnection<H.HeadersOpen>

Added in v0.1.0

setBody (method)

Signature

public setBody(body: string | Buffer): ConnectConnection<H.ResponseEnded>

Added in v0.1.0

pipeStream (method)

Signature

public pipeStream(
    stream: NodeJS.ReadableStream,
  ): ConnectConnection<H.ResponseEnded>

Added in v0.1.0

endResponse (method)

Signature

public endResponse(): ConnectConnection<H.ResponseEnded>

Added in v0.1.0

_S (property)

Signature

readonly _S: S

Added in v0.1.0

utils

fromRequestHandler

Signature

export declare const fromRequestHandler: <I = H.StatusOpen, E = never, A = never>(
  requestHandler: C.NextHandleFunction,
  f: (req: IncomingMessage) => E.Either<E, A>,
  onError: (reason: unknown) => E
) => M.Middleware<I, I, E, A>

Added in v0.1.0

toRequestHandler

Signature

export declare const toRequestHandler: <I, O, L>(middleware: M.Middleware<I, O, L, void>) => C.NextHandleFunction

Added in v0.1.0