Answers for "node read file stream"

1

node read file stream

const fs = require('fs');
const server = require('http').createServer();

server.on('request', (req, res) => {
  const src = fs.createReadStream('./big.file');
  src.pipe(res);
});

server.listen(8000);
Posted by: Guest on March-20-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language