Skip to content

Instantly share code, notes, and snippets.

@raycmorgan
Created March 31, 2010 00:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raycmorgan/349792 to your computer and use it in GitHub Desktop.
Save raycmorgan/349792 to your computer and use it in GitHub Desktop.
// Tested on Node version 0.1.32 and 0.1.33
var http = require('http'),
sys = require('sys');
http.createServer(function (request, response) {
response.writeHead(200, {'content-type': 'text/plain'});
response.write("Hello");
setTimeout(function () {
response.write("World")
response.close();
}, 2000);
}).listen(8000);
sys.puts("Listening on http://127.0.0.1:8000/");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment