Created
April 6, 2013 09:01
-
-
Save chakrit/5325483 to your computer and use it in GitHub Desktop.
Testing `end` event for response.
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
var http = require('http'); | |
http.createServer(function(req, resp) { | |
console.log('incoming request'); | |
resp.once('end', function() { | |
throw new Error('response is done'); | |
}); | |
setTimeout(function() { | |
resp.end('hi!'); | |
}, 1000); | |
}).listen(6789); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment