Skip to content

Instantly share code, notes, and snippets.

@voidnerd
Last active December 8, 2017 16:42
Show Gist options
  • Save voidnerd/97c90fd97f6bb6a7e0adcd5162466475 to your computer and use it in GitHub Desktop.
Save voidnerd/97c90fd97f6bb6a7e0adcd5162466475 to your computer and use it in GitHub Desktop.
var http = require('http');
var fs = require('fs');
var server = http.createServer(function (req, res) {
res.writeHead(200, { 'content-type': 'text/plain' })
fs.createReadStream(process.argv[3]).pipe(res);
})
server.listen(process.argv[2]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment