I was trying what I've seen in other questions with no luck:
I tried to override the default engine configuration with
app.register('.js.html', {
compiler: function(str,options){...}
});
but register is undefined in express js.
I got Bliss working this way
exports.index = function(req, res){
//res.render('index', {});
res.send(bliss.render(__dirname+"/index",{}));
};
but I'd like to use res.render('index',output) instead.
You have to set it up this way:
var Bliss = new require('bliss');
var bliss = new Bliss();
app.engine('.bliss',function(path,options,fn){
fn(null,bliss.render(path, options));
});
Then you call it like this:
exports.index = function(req, res){
res.render('user.bliss', { title: 'Express' });
};
You need a file called user.bliss under the views directory
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With