Skip to content

Instantly share code, notes, and snippets.

@gsf
Created May 22, 2013 23:37
Show Gist options
  • Select an option

  • Save gsf/5631789 to your computer and use it in GitHub Desktop.

Select an option

Save gsf/5631789 to your computer and use it in GitHub Desktop.
Pipe server
var http = require('http');
var server = http.createServer();
server.on('request', function (req, res) {
res.writeHead(200, {'Content-Type': 'application/json'});
req.pipe(res);
req.pipe(process.stdout);
});
server.listen(3000, function () {
console.log('Listening...');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment