Skip to main content Link Search Menu Expand Document (external link)

HttpMultiplex overview

Added in v1.0.0


Table of contents


combinators

add

Signature

export declare const add: {
  <E2, R2, E3, R3>(
    predicate: (request: ServerRequest.HttpServerRequest) => Effect.Effect<boolean, E2, R2>,
    app: App.Default<E3, R3>
  ): <E, R>(self: HttpMultiplex<E, R>) => HttpMultiplex<E2 | E3 | E, R2 | R3 | R>
  <E, R, E2, R2, E3, R3>(
    self: HttpMultiplex<E, R>,
    predicate: (request: ServerRequest.HttpServerRequest) => Effect.Effect<boolean, E2, R2>,
    app: App.Default<E3, R3>
  ): HttpMultiplex<E | E2 | E3, R | R2 | R3>
}

Added in v1.0.0

headerEndsWith

Signature

export declare const headerEndsWith: {
  <E2, R2>(
    header: string,
    suffix: string,
    app: App.Default<E2, R2>
  ): <E, R>(self: HttpMultiplex<E, R>) => HttpMultiplex<E2 | E, R2 | R>
  <E, R, E2, R2>(
    self: HttpMultiplex<E, R>,
    header: string,
    suffix: string,
    app: App.Default<E2, R2>
  ): HttpMultiplex<E | E2, R | R2>
}

Added in v1.0.0

headerExact

Signature

export declare const headerExact: {
  <E2, R2>(
    header: string,
    value: string,
    app: App.Default<E2, R2>
  ): <E, R>(self: HttpMultiplex<E, R>) => HttpMultiplex<E2 | E, R2 | R>
  <E, R, E2, R2>(
    self: HttpMultiplex<E, R>,
    header: string,
    value: string,
    app: App.Default<E2, R2>
  ): HttpMultiplex<E | E2, R | R2>
}

Added in v1.0.0

headerRegex

Signature

export declare const headerRegex: {
  <E2, R2>(
    header: string,
    regex: RegExp,
    app: App.Default<E2, R2>
  ): <E, R>(self: HttpMultiplex<E, R>) => HttpMultiplex<E2 | E, R2 | R>
  <E, R, E2, R2>(
    self: HttpMultiplex<E, R>,
    header: string,
    regex: RegExp,
    app: App.Default<E2, R2>
  ): HttpMultiplex<E | E2, R | R2>
}

Added in v1.0.0

headerStartsWith

Signature

export declare const headerStartsWith: {
  <E2, R2>(
    header: string,
    prefix: string,
    app: App.Default<E2, R2>
  ): <E, R>(self: HttpMultiplex<E, R>) => HttpMultiplex<E2 | E, R2 | R>
  <E, R, E2, R2>(
    self: HttpMultiplex<E, R>,
    header: string,
    prefix: string,
    app: App.Default<E2, R2>
  ): HttpMultiplex<E | E2, R | R2>
}

Added in v1.0.0

hostEndsWith

Signature

export declare const hostEndsWith: {
  <E2, R2>(suffix: string, app: App.Default<E2, R2>): <E, R>(self: HttpMultiplex<E, R>) => HttpMultiplex<E2 | E, R2 | R>
  <E, R, E2, R2>(self: HttpMultiplex<E, R>, suffix: string, app: App.Default<E2, R2>): HttpMultiplex<E | E2, R | R2>
}

Added in v1.0.0

hostExact

Signature

export declare const hostExact: {
  <E2, R2>(host: string, app: App.Default<E2, R2>): <E, R>(self: HttpMultiplex<E, R>) => HttpMultiplex<E2 | E, R2 | R>
  <E, R, E2, R2>(self: HttpMultiplex<E, R>, host: string, app: App.Default<E2, R2>): HttpMultiplex<E | E2, R | R2>
}

Added in v1.0.0

hostRegex

Signature

export declare const hostRegex: {
  <E2, R2>(regex: RegExp, app: App.Default<E2, R2>): <E, R>(self: HttpMultiplex<E, R>) => HttpMultiplex<E2 | E, R2 | R>
  <E, R, E2, R2>(self: HttpMultiplex<E, R>, regex: RegExp, app: App.Default<E2, R2>): HttpMultiplex<E | E2, R | R2>
}

Added in v1.0.0

hostStartsWith

Signature

export declare const hostStartsWith: {
  <E2, R2>(prefix: string, app: App.Default<E2, R2>): <E, R>(self: HttpMultiplex<E, R>) => HttpMultiplex<E2 | E, R2 | R>
  <E, R, E2, R2>(self: HttpMultiplex<E, R>, prefix: string, app: App.Default<E2, R2>): HttpMultiplex<E | E2, R | R2>
}

Added in v1.0.0

constructors

empty

Signature

export declare const empty: HttpMultiplex<never, never>

Added in v1.0.0

make

Signature

export declare const make: <E, R>(
  apps: Iterable<
    readonly [
      predicate: (request: ServerRequest.HttpServerRequest) => Effect.Effect<boolean, E, R>,
      app: App.Default<E, R>
    ]
  >
) => HttpMultiplex<E, R>

Added in v1.0.0

models

HttpMultiplex (interface)

Signature

export interface HttpMultiplex<E = never, R = never> extends App.Default<E | Error.RouteNotFound, R>, Inspectable {
  readonly [TypeId]: TypeId
  readonly apps: ReadonlyArray<
    readonly [
      predicate: (request: ServerRequest.HttpServerRequest) => Effect.Effect<boolean, E, R>,
      app: App.Default<E, R>
    ]
  >
}

Added in v1.0.0

type ids

TypeId

Signature

export declare const TypeId: typeof TypeId

Added in v1.0.0

TypeId (type alias)

Signature

export type TypeId = typeof TypeId

Added in v1.0.0