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

Function fileResponse

packages/platform/bun/src/BunHttpPlatform.ts:39–45  ·  view source on GitHub ↗
(path, status, statusText, headers, start, end, _contentLength)

Source from the content-addressed store, hash-verified

37 platform: "bun",
38 compression,
39 fileResponse(path, status, statusText, headers, start, end, _contentLength) {
40 let file = Bun.file(path)
41 if (start > 0 || end !== undefined) {
42 file = file.slice(start, end)
43 }
44 return Response.raw(file, { headers, status, statusText })
45 },
46 fileWebResponse(file, status, statusText, headers, options) {
47 const start = Number(options?.offset ?? 0)
48 const end = options?.bytesToRead !== undefined ? start + Number(options.bytesToRead) : undefined

Callers

nothing calls this directly

Calls 1

rawMethod · 0.80

Tested by

no test coverage detected