@routex/body-parser
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

Routex Body Parser npm Travis CI Codecov

Body parsing for Routex.

Documentation - GitHub

Example

Install:

yarn add @routex/body-parser
# or
npm add @routex/body-parser

Setup your app:

const { Routex, JsonBody } = require("routex");
const bodyParser = require("@routex/body-parser");

const port = process.env.PORT || 3000;
const app = new Routex();

app.use(bodyParser.json());

app.get("/", (ctx) => {
  ctx.body = new JsonBody(ctx.req.body);
});

app.listen(port).then(() => console.log(`Listening on ${port}`));

The parsed body is available under ctx.req.body.

Support

We support all currently active and maintained Node LTS versions, include current Node versions.

Please file feature requests and bugs at the issue tracker.

Readme

Keywords

Package Sidebar

Install

npm i @routex/body-parser

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

6.91 kB

Total Files

11

Last publish

Collaborators

  • cretezy