NodeHttpPlatform
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.
Constructors
Signature
declare const make: Effect<
{
readonly fileResponse: (
path: string,
options?: WithContent & {
readonly bytesToRead?: SizeInput;
readonly chunkSize?: SizeInput;
readonly offset?: SizeInput;
},
) => Effect<HttpServerResponse, PlatformError>;
readonly fileWebResponse: (
file: FileLike,
options?: WithContent & {
readonly bytesToRead?: SizeInput;
readonly chunkSize?: SizeInput;
readonly offset?: SizeInput;
},
) => Effect<HttpServerResponse>;
},
never,
Generator | FileSystem
>;
Creates the Node
HttpPlatform, serving file responses from Node readable streams and adding MIME type and content-length headers when needed.