diff options
author | Ryan <ry@tinyclouds.org> | 2009-05-27 17:42:16 +0400 |
---|---|---|
committer | Ryan <ry@tinyclouds.org> | 2009-05-27 17:42:16 +0400 |
commit | 1d8c4659d16d68d81726ecb1a944f7908df4f65a (patch) | |
tree | a8585d69702d157acafc5ba4750d0639f000dd1f /website | |
parent | b3338273b4a28d91557f14c60d40f75cb0ab5bf1 (diff) |
Just twiddling with the webpage
Diffstat (limited to 'website')
-rw-r--r-- | website/api.html | 12 | ||||
-rw-r--r-- | website/index.html | 35 | ||||
-rw-r--r-- | website/style.css | 8 |
3 files changed, 27 insertions, 28 deletions
diff --git a/website/api.html b/website/api.html index a87f721b3be..dc1a0cf6902 100644 --- a/website/api.html +++ b/website/api.html @@ -103,7 +103,7 @@ representation is rather inefficient. This will change in the future, when <a <dd> Stops a interval from triggering. </dd> </dl> -<h2 id="files">node.fs</h2> +<h2 id="files"><code>node.fs</code></h2> <p>File I/O is tricky because there are not simple non-blocking ways to do it. Node handles file I/O by employing <a @@ -702,8 +702,7 @@ read. <p>Node has a simple module loading system. In Node, files and modules are in one-to-one correspondence. - -<p> As an example, +As an example, <code>foo.js</code> loads the module <code>mjsunit.js</code>. <p>The contents of <code>foo.js</code>: @@ -730,7 +729,7 @@ exports.assertEquals = function (expected, found, name_opt) { }; </pre> -<p>Here the module <code>mjsunit.js</code> has exported the function +<p>The module <code>mjsunit</code> has exported a function <code>assertEquals()</code>. <code>mjsunit.js</code> must be in the same directory as <code>foo.js</code> for <code>include()</code> to find it. The module path is relative to the file calling <code>include()</code>. @@ -742,12 +741,11 @@ from the specified module into the global namespace. <p> Because file loading does not happen instantaneously, and because Node has a policy of never blocking, the callback <code >onLoad</code> can be set and will notify the user -when all the included modules are loaded. Each file/module can have an <code +when the included modules are loaded. Each file/module can have an <code >onLoad</code> callback. <p>To export an object, add to the special <code>exports</code> object. - -<p> The functions <code>fail</code> and <code>deepEquals</code> are not +The functions <code>fail</code> and <code>deepEquals</code> are not exported and remain private to the module. <p> <code>require()</code> is like <code>include()</code> except does not diff --git a/website/index.html b/website/index.html index cddf99c65fe..30a922f7fe2 100644 --- a/website/index.html +++ b/website/index.html @@ -17,26 +17,28 @@ <p id="introduction">Purely evented I/O for <a href="http://code.google.com/p/v8/">V8 javascript</a>. -<p>This is an example of a web server written with Node which responds with +<p>An example of a web server written with Node which responds with "Hello World" after waiting two seconds: -<pre>new node.http.Server(function (req, res) { +<pre> +new node.http.Server(function (req, res) { setTimeout(function () { res.sendHeader(200, [["Content-Type", "text/plain"]]); res.sendBody("Hello World"); res.finish(); }, 2000); }).listen(8000); -puts("Server running at http://127.0.0.1:8000/");</pre> +puts("Server running at http://127.0.0.1:8000/"); +</pre> -<p> To run the server, put the code into a file <code>server.js</code> +<p> To run the server, put the code into a file <code>example.js</code> and execute it with the <code>node</code> program -<pre class="sh_none">% /usr/local/bin/node server.js +<pre class="sh_none">% /usr/local/bin/node example.js Server running at http://127.0.0.1:8000/ </pre> -<p> See <a href="api.html">the API documentation</a> for more examples. +<p> See the <a href="api.html">API documentation</a> for more examples. <p> Node is released under an MIT license.</p> @@ -48,18 +50,23 @@ Server running at http://127.0.0.1:8000/ <h2 id="build">Build</h2> <p>Node aims to support all POSIX operating systems (including -Windows with mingw). However at the moment it is only being tested on -Macintosh and Linux. - -<p>V8, on which Node is built, supports only IA-32 and ARM processors. - -<p> The build system requires Python. +Windows with mingw) but at the moment it is only being tested on +Linux, Macintosh, and FreeBSD. +The build system requires Python. +V8, on which Node is built, supports only IA-32 and ARM processors. -<pre class="sh_none">./configure +<pre class="sh_none"> +./configure make -make install</pre> +make install +</pre> +<p>To run the unit tests +<pre class="sh_none"> +./configure --debug +make test +</pre> </body> </html> diff --git a/website/style.css b/website/style.css index d7bd92940ee..4e9eb333bcc 100644 --- a/website/style.css +++ b/website/style.css @@ -44,7 +44,7 @@ h1 a, h2 a, h3 a, h4 a pre, code { font-family: monospace; font-size: 14pt; - color: #fee; + color: #eee0e0; } pre { @@ -52,12 +52,6 @@ pre { border-left: 1px solid #444; } -dl { -} - -dt { -} - dd { margin: 1em 0; margin-left: 1em; |