0.0.2 • Published 9 years ago
koa-mustache v0.0.2
koa-mustache 
NOTE: for koa@2.0.0 + only.
Feature
- Visit
/,/indexwill get resolved to/index.mustache - Visit
/homewill get resolved to/home.mustacheor/home/index.mustache - If there is a
.jsonor.data.js(which exports a object) file with same name beside the template file, it will be used as it's data source.
Usage
const Koa = require('koa')
const koaMustache = require('koa-mustache')
const app = new Koa()
app.use(koaMustache(__dirname + '/public', {
extension: 'html'
}))
app.listen(3000)Options
partialsDir(="_partials"): a directory inside public folder, for partial files.extension(="mustache"): custom file extension to be recognized as mustache template.debug(=false): enable debug log.
License
ISC © Amio