Passing a value back to a module
I just started to look at node and I don't understand how I can pass a
value back to a module... I've searched and searched but its just not
clicking so I thought I'd ask.
My app.js contains:
app.get('/test', controller.test);
My module.js contains:
exports.test = function(req, res){
console.log("Called test Successfully");
res.json(200, {message: 'success'});
}
My index.jade contains:
$('.someID').on('click', function(){
$.get('/test');
});
What I'd like to be able to do is pass something from my index.jade back
to the module so I can see it in the console.log.... console.log("Called
test Successfully" + somevalue);
Thanks
No comments:
Post a Comment