Skip to content

Instantly share code, notes, and snippets.

@deepakshrma
Created January 6, 2020 17:00
Show Gist options
  • Save deepakshrma/c5d0d0e6b9cf7a4fa4b2dad5ee7c118c to your computer and use it in GitHub Desktop.
Save deepakshrma/c5d0d0e6b9cf7a4fa4b2dad5ee7c118c to your computer and use it in GitHub Desktop.
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