mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
Doc changes for new API (part 1)
This commit is contained in:
1 parent
b544185bd8
commit
499c615c9e
2 files changed
+404
-328
No files matched your search
+401
-325
File diff suppressed because it is too large.
Load diff
+3
-3
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user