summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMichael Hart <michael.hart.au@gmail.com>2013-03-30 12:29:50 +1100
committerisaacs <i@izs.me>2013-04-01 10:09:27 -0700
commit440dcae98744954d1528506f2648aff71aadde25 (patch)
treeaeaaffa6ea99b278e35ae0d7731b18318794f912 /doc
parente5b90a14b816000a00b3e97dcc2f36805b893ab7 (diff)
downloadnode-new-440dcae98744954d1528506f2648aff71aadde25.tar.gz
Ensure BAD domain example actually uses domain
Diffstat (limited to 'doc')
-rw-r--r--doc/api/domain.markdown8
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