Created
November 5, 2010 17:32
-
-
Save jpadilla/664491 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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/'); |
Author
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
node!! you give a talk on it?