@zcorky/koa-body
v0.0.1
Published
body parser for koa
Downloads
3
Readme
koa-body
body parser for Koa.
Install
$ npm install @zcorky/koa-body
Usage
// See more in test
import onerror from '@zcorky/onerror';
import bodyParser from '@zcorky/koa-body';
import * as router from '@zcorky/koa-router';
import * as Koa from 'koa';
const app = new Koa();
app.use(onerror());
app.use(bodyParse());
app.use(router.post('/', ctx => {
ctx.body = ctx.request.body;
}));
app.listen(8000, '0.0.0.0', () => {
console.log('koa server start at port: 8000');
});