NodeHttpPlatform.ts
NodeHttpPlatform.ts overview
Section titled “NodeHttpPlatform.ts overview”Node.js implementation of the Effect HTTP platform service.
This module connects the portable HttpPlatform file response helpers to
Node runtime primitives. It serves local files through Node readable streams,
supports byte ranges, converts Web File values to readable streams, and
fills in content type and content length headers when needed.
Since v4.0.0
Exports Grouped by Category
Section titled “Exports Grouped by Category”constructors
Section titled “constructors”Creates the Node HttpPlatform, serving file responses from Node readable
streams and adding MIME type and content-length headers when needed.
Signature
declare const make: Effect< { readonly fileResponse: ( path: string, options?: ServerResponse.Options.WithContent & { readonly bytesToRead?: SizeInput | undefined readonly chunkSize?: SizeInput | undefined readonly offset?: SizeInput | undefined } ) => Effect<ServerResponse.HttpServerResponse, PlatformError> readonly fileWebResponse: ( file: HttpBody.FileLike, options?: ServerResponse.Options.WithContent & { readonly bytesToRead?: SizeInput | undefined readonly chunkSize?: SizeInput | undefined readonly offset?: SizeInput | undefined } ) => Effect<ServerResponse.HttpServerResponse> }, never, FileSystem | EtagImpl.Generator>Since v4.0.0
layers
Section titled “layers”Provides the Node HttpPlatform together with the filesystem and ETag
services it needs for file responses.
Signature
declare const layer: Layer.Layer<Platform.HttpPlatform, never, never>Since v4.0.0