Skip to content

Instantly share code, notes, and snippets.

@figital
Created August 5, 2011 16:22
Show Gist options
  • Save figital/1127904 to your computer and use it in GitHub Desktop.
Save figital/1127904 to your computer and use it in GitHub Desktop.
this might be easier to understand for step 0.
// An attempt to simplify the basic node starter script.
// USAGE: node demo.js
var http = require('http');
function listener(request, response) {
console.log('URI: ' + request.url);
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end('Hello, World\n');
}
http.createServer(listener).listen(1337, 'localhost');
console.log('Server running at http://localhost:1337');
@figital
Copy link
Author

figital commented Aug 5, 2011

request.url is the "script_name" or "uri" ... imho ... could not saying "URI" simplify?

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