alp-body-parser
TypeScript icon, indicating that this package has built-in type declarations

9.0.0 • Public • Published

alp-body-parser

body parser in alp framework

Install

npm install --save alp-body-parser

Usage

import Koa from 'koa';
import { config } from 'alp-node';
import bodyParser from 'alp-body-parser';

const app = new Koa();
config(`${__dirname}/config`, { packageConfig })(app);
bodyParser(app);
export default {
  async form(ctx) {
    const body = await ctx.parseBody();
  },

  async json(ctx) {
    const body = await ctx.parseBodyJson();
  },

  async text(ctx) {
    const body = await ctx.parseBodyText();
  },
};

Readme

Keywords

Package Sidebar

Install

npm i alp-body-parser

Weekly Downloads

21

Version

9.0.0

License

ISC

Unpacked Size

22.5 kB

Total Files

10

Last publish

Collaborators

  • churpeau