Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/naxmefy/node-koa-controllers
koa2 controllers
https://github.com/naxmefy/node-koa-controllers
Last synced: 5 days ago
JSON representation
koa2 controllers
- Host: GitHub
- URL: https://github.com/naxmefy/node-koa-controllers
- Owner: naxmefy
- License: mit
- Created: 2016-09-03T11:51:45.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-09-07T20:09:42.000Z (about 8 years ago)
- Last Synced: 2024-04-14T07:52:20.596Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-koa-controllers
[![npm version](https://badge.fury.io/js/%40naxmefy%2Fkoa-controllers.svg)](https://badge.fury.io/js/%40naxmefy%2Fkoa-controllers)
[![Build Status](https://travis-ci.org/naxmefy/node-koa-controllers.svg?branch=master)](https://travis-ci.org/naxmefy/node-koa-controllers)
[![Coverage Status](https://coveralls.io/repos/github/naxmefy/node-koa-controllers/badge.svg?branch=master)](https://coveralls.io/github/naxmefy/node-koa-controllers?branch=master)## Installation
```
$ npm install --save @naxmefy/koa-controllers
```## Usage
```JavaScript
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')
}
}
```