|
|
|
|
|
by thinknlive
5193 days ago
|
|
// response : http response stream
// filename : the static file we want to serve response.writeHead(200 /, ...set http header info (mime, length etc).../ );
stream = fs.createReadStream(
filename,
{ flags: 'r',
start: start,
end: end });
stream.pipe(response); |
|