diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2009-09-23 19:00:20 +0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2009-09-23 19:00:20 +0400 |
commit | 2d256f34c5c8aa4243798e228052e7fa2d04632d (patch) | |
tree | 7c4b9b0295ef2ce61807e2cf2df04b0ac6a86b7a /doc | |
parent | 8c7babdf10dde35c71d097130daa670cd52d1160 (diff) |
Change example at beginning of api.txt
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api.html | 12 | ||||
-rw-r--r-- | doc/api.txt | 10 | ||||
-rw-r--r-- | doc/node.1 | 10 |
3 files changed, 13 insertions, 19 deletions
diff --git a/doc/api.html b/doc/api.html index b75fa1204fc..09e1ca775ae 100644 --- a/doc/api.html +++ b/doc/api.html @@ -33,15 +33,13 @@ window.onload = function(){generateToc(2)} <h2 id="_synopsis">SYNOPSIS</h2>
<div class="sectionbody">
<div class="paragraph"><p>An example of a web server written with Node which responds with "Hello
-World" after waiting two seconds:</p></div>
+World":</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>node.http.createServer(function (request, response) {
- setTimeout(function () {
- response.sendHeader(200, {"Content-Type": "text/plain"});
- response.sendBody("Hello World");
- response.finish();
- }, 2000);
+ response.sendHeader(200, {"Content-Type": "text/plain"});
+ response.sendBody("Hello World\n");
+ response.finish();
}).listen(8000);
puts("Server running at http://127.0.0.1:8000/");</tt></pre>
</div></div>
@@ -1946,7 +1944,7 @@ init (Handle<Object> target) <div id="footer">
<div id="footer-text">
Version 0.1.11<br />
-Last updated 2009-09-23 16:52:08 CEST
+Last updated 2009-09-23 16:59:33 CEST
</div>
</div>
</body>
diff --git a/doc/api.txt b/doc/api.txt index b9ed53bb3e4..96659b67ed7 100644 --- a/doc/api.txt +++ b/doc/api.txt @@ -13,15 +13,13 @@ node - evented I/O for V8 javascript == SYNOPSIS An example of a web server written with Node which responds with "Hello -World" after waiting two seconds: +World": ---------------------------------------- node.http.createServer(function (request, response) { - setTimeout(function () { - response.sendHeader(200, {"Content-Type": "text/plain"}); - response.sendBody("Hello World"); - response.finish(); - }, 2000); + response.sendHeader(200, {"Content-Type": "text/plain"}); + response.sendBody("Hello World\n"); + response.finish(); }).listen(8000); puts("Server running at http://127.0.0.1:8000/"); ---------------------------------------- diff --git a/doc/node.1 b/doc/node.1 index bd8e7b6b594..d553bb86303 100644 --- a/doc/node.1 +++ b/doc/node.1 @@ -13,17 +13,15 @@ .SH "NAME" node - evented I/O for V8 javascript .SH "SYNOPSIS" -An example of a web server written with Node which responds with "Hello World" after waiting two seconds: +An example of a web server written with Node which responds with "Hello World": .sp .sp .RS 4 .nf node\.http\.createServer(function (request, response) { - setTimeout(function () { - response\.sendHeader(200, {"Content\-Type": "text/plain"}); - response\.sendBody("Hello World"); - response\.finish(); - }, 2000); + response\.sendHeader(200, {"Content\-Type": "text/plain"}); + response\.sendBody("Hello World\en"); + response\.finish(); })\.listen(8000); puts("Server running at http://127\.0\.0\.1:8000/"); .fi |