Browse Source

Change example at beginning of api.txt

v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
2d256f34c5
  1. 12
      doc/api.html
  2. 10
      doc/api.txt
  3. 10
      doc/node.1

12
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&lt;Object&gt; 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>

10
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/");
----------------------------------------

10
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

Loading…
Cancel
Save