Created
August 5, 2011 16:22
-
-
Save figital/1127904 to your computer and use it in GitHub Desktop.
this might be easier to understand for step 0.
This file contains 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
// 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'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
request.url is the "script_name" or "uri" ... imho ... could not saying "URI" simplify?