Just twiddling with the webpage

This commit is contained in:
Ryan 2009-05-27 15:42:16 +02:00
Родитель b3338273b4
Коммит 1d8c4659d1
3 изменённых файлов: 27 добавлений и 28 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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.
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.
<p>V8, on which Node is built, supports only IA-32 and ARM processors.
<p> The build system requires Python.
<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>

Просмотреть файл

@ -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;