Skip to content

Instantly share code, notes, and snippets.

@rajat1saxena
Created August 6, 2017 17:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajat1saxena/8a1490334321b95048d615cd8a129d17 to your computer and use it in GitHub Desktop.
Save rajat1saxena/8a1490334321b95048d615cd8a129d17 to your computer and use it in GitHub Desktop.
const fs = require('fs');
const http = require('http');
const server = http.createServer((req, res) => {
// res.setHeader('Content-Type', 'video/mp4');
const fil = fs.createReadStream('/home/rajat/Videos/apparchitecture.mp4');
const head2 = {
'Content-Type': 'video/mp4',
};
res.writeHead(200, head2);
fil.pipe(res);
}).listen(8000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment