0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 21:19:50 +01:00
nodejs/count-hosts.js

14 lines
398 B
JavaScript

function Process(request) {
log("Processing " + request.path + ". method: " + request.method);
// sends null on the last chunk.
request.onBody = function (chunk) {
log("body chunk: '" + chunk + "'");
}
request.respond("HTTP/1.0 200 OK\r\n")
request.respond("Content-Type: text-plain\r\n")
request.respond("Content-Length: 6\r\n\r\nhello\n");
request.respond(null); // eof
}