Skip to content

koexjs/body

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

body

NPM version NPM quality Coverage Status Dependencies Build Status Known Vulnerabilities NPM download license issues

body parser for koa extend.

Install

$ npm install @koex/body

Usage

// See more in test
import onerror from '@koex/onerror';
import bodyParser from '@koex/body';
import * as router from '@koex/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');
});

Related

About

body parser for koa

Resources

License

Stars

Watchers

Forks

Packages

No packages published