0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test_http.js
2009-05-19 13:12:46 +02:00

9 lines
267 B
JavaScript

new node.http.Server(function (req, res) {
puts("got req to " + req.uri.path);
setTimeout(function () {
res.sendHeader(200, [["Content-Type", "text/plain"]]);
res.sendBody(JSON.stringify(req.uri));
res.finish();
}, 1);
}).listen(8000, "localhost");