Skip to content

Instantly share code, notes, and snippets.

@marcello3d
Created February 11, 2011 04:48
Show Gist options
  • Save marcello3d/821937 to your computer and use it in GitHub Desktop.
Save marcello3d/821937 to your computer and use it in GitHub Desktop.
var http = require('http')
var config = {
host: '127.0.0.1',
port: 20202
}
http.createServer(function (i,o) {
o.writeHead(200, {
'Content-Type': 'text/plain'
})
o.write('Hello thar 1\n')
setTimeout(function() {
o.write('Hello thar 2\n')
o.end()
},2000)
}).listen(config.port, function() {
var address = this.address()
console.log("Started http://%s:%d", address.address, address.port)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment