Skip to content
Effect 4.0 is here. One ecosystem. Zero dependencies.

HttpPlatform

6 exports Since v1.0.0 Source

Constructors

Since v1.0.0

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

Since v1.0.0

Signature

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

Models

HttpPlatform

interface
Since v1.0.0

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

Signature

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

Type Ids

Since v1.0.0

Signature

declare const TypeId: unique symbol
Since v1.0.0

Signature

type TypeId = typeof TypeId