You can do the same as here lib/hooks/views/index.js (in your sails hook)
sails.on('router:before', function() {
sails.router.bind('/*', function(req, res, next) {
// here you can reimplement the res.render method, of example:
res.render = function render(data) {
// For access `req` data in your template engine,
// many useful info stored here like:
// req.options.controller – current `controller`
// req.options.action – current `action`
data.req = req;
var html = yourTemplateEngineRender(data);
res.set({
'Content-Type': 'text/html',
'Content-Length': Buffer.byteLength(html, 'utf8')
});
res.send(html);
}
}, 'all');
});
See my hook which enables bem rendering for sails: sails-hook-bem-render