Created
January 6, 2020 17:00
-
-
Save deepakshrma/c5d0d0e6b9cf7a4fa4b2dad5ee7c118c to your computer and use it in GitHub Desktop.
This file contains hidden or 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"); | |
function main() { | |
const server = http.createServer((req, res) => { | |
// console.time("START:NODE"); | |
fs.createReadStream("./test1.txt") | |
.pipe(res) | |
// .on("finish", () => { | |
// console.timeEnd("START:NODE"); | |
// }); | |
// res.write("hello") | |
// res.end() | |
}); | |
server.listen(8080); | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment