Skip to content

Instantly share code, notes, and snippets.

@sizzlemctwizzle
Last active December 27, 2015 17:39
Show Gist options
  • Select an option

  • Save sizzlemctwizzle/7363414 to your computer and use it in GitHub Desktop.

Select an option

Save sizzlemctwizzle/7363414 to your computer and use it in GitHub Desktop.
World's simplest Express view wrapper for [Mu](https://github.com/raycmorgan/Mu)
var mu = require('mu2');
exports.renderFile = function(path, options, response) {
mu.compileAndRender(path, options).pipe(response);
}
/* Usage:
app.engine('html', require('muExpress').renderFile);
app.set('view engine', 'html');
app.set('views', __dirname + '/views');
app.get('/', function(req, res) {
res.render('index', { 'title': 'Home page' }, res);
});
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment