1.2.0 • Published 6 years ago

koa-json-router v1.2.0

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

koa-json-router

npm.io

Simple wrapper for koa-router@next which assumes the resolved value from a handler is the desired return value.

Installation

npm install koa-json-router

Usage

const Koa = require('koa');
const KoaJsonRouter = require('koa-json-router');

const app = new Koa();
const router = new KoaJsonRouter({ prefix: '/api' });

router.get('/foo', async ctx => {
  return {
    foo: 'bar'
  }
});

app.use(router.routes());
1.2.0

6 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago