I have "global" variable that can be called all over my nodejs program. I just want to wrap my response object into "global" variable.
i can render with this:
http.createServer(function (request, response) {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end('Hello World\n');
}).listen(8081);`
but with this not:
global.render : function(res,result){
**res.writeHead(200,{'Content-Type': 'text/plain'});**
res.end(''+ result);
}
Using;
global.render(res, 'this just in html');
This bold row gives me an error. Cant figure it out?