A HTTP server helper for streaming resources.
file-stream is a little HTTP server helper that streams binary resources. These resources will commonly be audio or video, but any type of file is fair game.
npm install file-stream
file-stream(path (string):the filesystem path of the file being requested.request (IncomingMessage):the request object provided by http.createServer.response (ServerResponse):the response object provided by http.createServer.)=> handled (boolean)
var http = require'http'var stream = require'file-stream'var filepath = '/path/to/file'httpcreateServer// If file-stream can’t handle the request// it will return false.if !streamfilepath req resresstatusCode = 500ressetHeader'Content-Type' 'text/plain'resend'unable to stream ' + filepath + '\n'listen8080