diff options
author | Michael Hart <michael.hart.au@gmail.com> | 2013-03-30 12:29:50 +1100 |
---|---|---|
committer | isaacs <i@izs.me> | 2013-04-01 10:09:27 -0700 |
commit | 440dcae98744954d1528506f2648aff71aadde25 (patch) | |
tree | aeaaffa6ea99b278e35ae0d7731b18318794f912 /doc | |
parent | e5b90a14b816000a00b3e97dcc2f36805b893ab7 (diff) | |
download | node-new-440dcae98744954d1528506f2648aff71aadde25.tar.gz |
Ensure BAD domain example actually uses domain
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/domain.markdown | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/doc/api/domain.markdown b/doc/api/domain.markdown index 4a0ee67dbb..b93c3fcd62 100644 --- a/doc/api/domain.markdown +++ b/doc/api/domain.markdown @@ -48,9 +48,11 @@ d.on('error', function(er) { // This is no better than process.on('uncaughtException')! console.log('error, but oh well', er.message); }); -require('http').createServer(function(req, res) { - handleRequest(req, res); -}).listen(PORT); +d.run(function() { + require('http').createServer(function(req, res) { + handleRequest(req, res); + }).listen(PORT); +}); ``` By using the context of a domain, and the resilience of separating our |