Doc changes for new API (part 1)

This commit is contained in:
Ryan Dahl 2010-04-08 14:22:30 -07:00
parent b544185bd8
commit 499c615c9e
2 changed files with 404 additions and 328 deletions

File diff suppressed because it is too large Load Diff

View File

@ -42,12 +42,12 @@
</p>
<pre>
var sys = require('sys'),
var sys = require('sys'),
http = require('http');
http.createServer(function (req, res) {
setTimeout(function () {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.close('Hello World');
res.end('Hello World\n');
}, 2000);
}).listen(8000);
sys.puts('Server running at http://127.0.0.1:8000/');</pre>
@ -79,7 +79,7 @@ var server = tcp.createServer(function (socket) {
});
socket.addListener("end", function () {
socket.write("goodbye\r\n");
socket.close();
socket.end();
});
});
server.listen(7000, "localhost");</pre>