Skip to content

Instantly share code, notes, and snippets.

@jdub
Created January 21, 2011 15:57
Show Gist options
  • Save jdub/789879 to your computer and use it in GitHub Desktop.
Save jdub/789879 to your computer and use it in GitHub Desktop.
var http = require('http'), cons = 0;
http.createServer(function(req, res) {
var mycon = ++cons;
res.writeHead(200,
{'Content-Type': 'text/plain'});
res.write('Hello... ');
setTimeout(function() {
res.end('world! #' + mycon + '\n');
}, 2000);
}).listen(8000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment