Created
June 8, 2011 22:54
-
-
Save bnoordhuis/1015649 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
require('http').createServer(function(req, res) { | |
console.error('Request', req.headers); | |
req.on('data', function(chunk) { | |
console.error('Received chunk', chunk, chunk.toString()); | |
}); | |
setTimeout(function() { | |
var body = "Hello World\n"; | |
res.writeHead(200, { | |
'Content-Type': 'text/plain', | |
'Content-Length': '' + body.length | |
}); | |
res.end(body); | |
}, 500); | |
}).listen(8001); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment