Docs for app.render:
Render a view with a callback responding with the rendered string. This is the app-level variant of
res.render(), an
along with these two variants, there is also jade.renderFile which generates html that need not be passed to the client.
usage-
var jade = require('jade');
exports.getJson = getJson;
function getJson(req, res) {
var html = jade.renderFile('views/test.jade', {some:'json'});
res.send({message: 'i sent json'});
}
getJson() is available as a route in app.js.