node.js - How to configure Bliss Templating in express js? -


i trying i've seen in other questions no luck:

i tried override default engine configuration

app.register('.js.html', {     compiler: function(str,options){...} }); 

but register undefined in express js.

i got bliss working way

exports.index = function(req, res){     //res.render('index', {});     res.send(bliss.render(__dirname+"/index",{})); }; 

but i'd use res.render('index',output) instead.

you have set way:

var bliss = new require('bliss'); var bliss = new bliss(); app.engine('.bliss',function(path,options,fn){     fn(null,bliss.render(path, options)); }); 

then call this:

exports.index = function(req, res){   res.render('user.bliss', { title: 'express' }); }; 

you need file called user.bliss under views directory


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -