I have defined an http server by requiring as follows:
var http = require('http');
function onRequest(request, response) {
console.log("Request" + request);
console.log("Reponse" + response);
}
http.createServer(onRequest).listen(8080);
I would like to pass the http object to a JS class (in a separate file) where I load external modules that are specific to my application.
Any suggestions on how would I do this?
Thanks, Mark