Last active
December 27, 2015 17:39
-
-
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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