1.0.9 • Published 6 years ago

koa-router-aux v1.0.9

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

koa-router-aux

An koa-router auxiliary tool.setting up the route by decorator.

only available for typescript.

Example

import route from 'koa-router-aux';
const Koa = require('koa');
const Router = require('koa-router');
const app = new Koa();
const router = new Router();

route.setRouter(router);

class TestController {
    @route.get('/api/user')
    async user(ctx: any) {
        ctx.response.body = { name: 'Alex' };
    }
}

new TestController();
app.use(router.routes()).use(router.allowedMethods());
app.listen(3000);
1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago