Connect middleware to compile requested html file as a mustache template before serving the response. Also allow mustache partials to be included using file system.
var mustacheEngine = require('connect-mustache-middleware');
connect().use(mustacheEngine.middleware({
rootDir: '.tmp', // path to look mustache templates
dataDir: 'mock/data' // path to look for JSON data files
}))
npm install connect-mustache-middleware
- Works as connect middleware and compile requested HTML file as mustache template.
- Allow mustache partials to be included using file system.