MCPcopy Create free account
hub / github.com/axios/axios / pipeFileToResponse

Function pipeFileToResponse

examples/server.js:69–76  ·  view source on GitHub ↗
(res, file, type)

Source from the content-addressed store, hash-verified

67}
68
69function pipeFileToResponse(res, file, type) {
70 if (type) {
71 res.writeHead(200, {
72 'Content-Type': type
73 });
74 }
75 fs.createReadStream(path.join(__dirname, file)).pipe(res);
76}
77
78
79dirs = listDirs(__dirname);

Callers 1

server.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected