@naxmefy/koa-controllers
v0.2.0
Published
koa2 controllers
Downloads
3
Readme
node-koa-controllers
Installation
$ npm install --save @naxmefy/koa-controllers
Usage
import * as Controllers from '@naxmefy/koa-controllers'
class MyKoaController extends Controllers.AppController {
async myUsers (ctx) {
this.body = yield ctx.db.findMyUsers()
}
async myUsersView (ctx) {
ctx.state.users = yield ctx.db.findMyUsers()
ctx.render('userListView')
}
}