I need to display HAML templates in my Node.js / Express application. I tried to configure haml.js as view renderer:
haml = require('hamljs') ... app.set('view engine', 'hamljs') app.engine('.haml', haml.render)
And the code in my GET /
handeler:
options = layout: "layout.haml" locals: message: 'world' res.render('index.haml',options)
But the application does not receive any data.
This is another example in the haml.js documentation :
app.engine('.haml', require('hamljs').renderFile);
But there is no such function.
source share