Here is the typical hello world example given in most books for Node.JS -
var http = require('http');
http.createServer(function (req, res) {
res.**writeHead**(200, {'Content-Type': 'text/plain'});
res.**end**('Hello World\n');
}).listen(8124, "127.0.0.1");
I can understand that via the "require" html functionality has been put into the var http. so .createserver function would be written in that module, to which as a parameter for callback we are passing an anonymous function. However where is "writehead" and "end" defined? and what is it exactly?
res is an instance of the class ServerResponse http://nodejs.org/api/http.html#http_class_http_serverresponse