MCPcopy Create free account
hub / github.com/Effect-TS/effect / fileResponse

Function fileResponse

packages/effect/src/unstable/http/HttpPlatform.ts:155–163  ·  view source on GitHub ↗
(path, status, statusText, headers, start, end, contentLength)

Source from the content-addressed store, hash-verified

153 platform: "web",
154 compression: internal.compressionWeb,
155 fileResponse(path, status, statusText, headers, start, end, contentLength) {
156 return Response.stream(
157 fs.stream(path, {
158 offset: start,
159 bytesToRead: end !== undefined ? end - start : undefined
160 }),
161 { contentLength, headers, status, statusText }
162 )
163 },
164 fileWebResponse(file, status, statusText, headers, options) {
165 const offset = Number(options?.offset ?? 0)
166 const bytesToRead = options?.bytesToRead !== undefined ? Number(options.bytesToRead) : undefined

Callers

nothing calls this directly

Calls 1

streamMethod · 0.65

Tested by

no test coverage detected