Created
August 20, 2018 17:27
-
-
Save chaiwa-berian/aa07282e93bcddff42cad23099c0b8db 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 http = require('http'); | |
const fs = require('fs'); | |
var server = http.createServer((req, res)=>{ | |
var stream = fs.createReadStream(__dirname + '/data.txt'); | |
stream.pipe(res); | |
}); | |
server.listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment