Skip to content

Commit

Permalink
Merge pull request #16 from fruit-memory/dev
Browse files Browse the repository at this point in the history
update README.md for koa2
  • Loading branch information
yiminghe authored Jan 2, 2018
2 parents 5c3d719 + d5f13ce commit 4c38d62
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,20 @@ app.use(function*(){
});
```

### use for koa2

```javascript
const koa = require('koa'),
app = new koa()
const xtpl = require('xtpl/lib/koa2')
xtpl(app, {
views:'./views'
});
app.use(async (ctx, next) => {
ctx.body = await ctx.render('test',{data:1});
});
```

## Example

├── footer.xtpl
Expand Down

0 comments on commit 4c38d62

Please sign in to comment.