Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMichael Hart <michael.hart.au@gmail.com>2013-03-30 05:29:50 +0400
committerisaacs <i@izs.me>2013-04-01 21:09:27 +0400
commit440dcae98744954d1528506f2648aff71aadde25 (patch)
treeaeaaffa6ea99b278e35ae0d7731b18318794f912 /doc
parente5b90a14b816000a00b3e97dcc2f36805b893ab7 (diff)
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 4a0ee67dbba..b93c3fcd622 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