Skip to content

HttpPlatform

6 exports Added in v1.0.0 Source

Constructors

make

Added in v1.0.0 Source

Signature

declare const make: (impl: {
  readonly fileResponse: (
    path: string,
    status: number,
    statusText: string | undefined,
    headers: Headers.Headers,
    start: number,
    end: number | undefined,
    contentLength: number,
  ) => ServerResponse.HttpServerResponse;
  readonly fileWebResponse: (
    file: Body.HttpBody.FileLike,
    status: number,
    statusText: string | undefined,
    headers: Headers.Headers,
    options?: FileSystem.StreamOptions,
  ) => ServerResponse.HttpServerResponse;
}) => Effect.Effect<HttpPlatform, never, FileSystem.FileSystem | Etag.Generator>;

Layers

layer

Added in v1.0.0 Source

Signature

declare const layer: Layer<HttpPlatform, never, FileSystem.FileSystem>;

Models

HttpPlatform interface

Added in v1.0.0 Source

Signature

interface HttpPlatform {
  readonly [TypeId]: typeof TypeId;
  readonly fileResponse: (
    path: string,
    options?: WithContent & StreamOptions,
  ) => Effect<HttpServerResponse, PlatformError>;
  readonly fileWebResponse: (
    file: FileLike,
    options?: WithContent & StreamOptions,
  ) => Effect<HttpServerResponse>;
}

Tags

HttpPlatform

Added in v1.0.0 Source

Signature

declare const HttpPlatform: Context.Tag<HttpPlatform, HttpPlatform>;

Type Ids

TypeId

Added in v1.0.0 Source

Signature

declare const TypeId: unique symbol;

TypeId type

Added in v1.0.0 Source

Signature

type TypeId = typeof TypeId;