Skip to content

Instantly share code, notes, and snippets.

@jpadilla
Created November 5, 2010 17:32
Show Gist options
  • Select an option

  • Save jpadilla/664491 to your computer and use it in GitHub Desktop.

Select an option

Save jpadilla/664491 to your computer and use it in GitHub Desktop.
// Import standard system and HTTP libraries
var sys = require('sys'),
http = require('http');
// Create an HTTP server listening on port 8000 and attach a function to handle incoming requests
http.createServer(function (request, response) {
//Set response headers
response.writeHead(200, {'Content-Type': 'text/plain'});
response.write('Wait 2 seconds... ');
setTimeout(function () {
//Send the body....
response.write('Hello Barcamp San Juan!');
//Finish the request
response.end();
}, 2000);
}).listen(8000);
sys.puts('Server running at http://127.0.0.1:8000/');
@rlr
Copy link

rlr commented Nov 9, 2010

node!! you give a talk on it?

@jpadilla
Copy link
Author

jpadilla commented Nov 9, 2010

Sip. Fue mi last minute unprepared talk para el BarcampSJ lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment