From 2d256f34c5c8aa4243798e228052e7fa2d04632d Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Wed, 23 Sep 2009 17:00:20 +0200 Subject: [PATCH] Change example at beginning of api.txt --- doc/api.html | 12 +++++------- doc/api.txt | 10 ++++------ doc/node.1 | 10 ++++------ 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/doc/api.html b/doc/api.html index b75fa1204f..09e1ca775a 100644 --- a/doc/api.html +++ b/doc/api.html @@ -33,15 +33,13 @@ window.onload = function(){generateToc(2)}

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/");
@@ -1946,7 +1944,7 @@ init (Handle<Object> target) diff --git a/doc/api.txt b/doc/api.txt index b9ed53bb3e..96659b67ed 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 bd8e7b6b59..d553bb8630 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