koa-simple-nunjucks
v1.1.2
Published
koa middleware for nunjucks
Downloads
2
Readme
Koa middleware for Nunjucks.
Install
$ npm install --save-dev koa-simple-nunjucks
Usage
const app = require('koa')()
const nj = require('koa-simple-nunjucks')
app.use(nj({
path: 'template'
}, {
watch: true
}))
app.use(function*(next) {
yield this.render('index.html', { body: 'Hello World' })
})
app.listen(3000)
Examples
$ git clone https://github.com/cjg125/koa-simple-nunjucks.git demo
$ cd demo
$ node examples/
# http://127.0.0.1:3000/