Created
August 6, 2017 17:02
-
-
Save rajat1saxena/8a1490334321b95048d615cd8a129d17 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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