Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix usage for @koa/bodyparser v5 use const { bodyParser } = req… #154

Merged
merged 1 commit into from
Jul 8, 2023

Commits on Jul 8, 2023

  1. docs: fix usage for @koa/bodyparser v5 use const { bodyParser } = req…

    …uire("@koa/bodyparser")
    
    ```js
    const Koa = require("koa");
    const { bodyParser } = require("@koa/bodyparser")
    
    const app = new Koa();
    app.use(bodyParser());
    
    app.use((ctx) => {
      // the parsed body will store in ctx.request.body
      // if nothing was parsed, body will be an empty object {}
      ctx.body = ctx.request.body;
    });
    ```
    i5ting committed Jul 8, 2023
    Configuration menu
    Copy the full SHA
    dec3bbd View commit details
    Browse the repository at this point in the history