Skip to content

Commit

Permalink
Update README.md (#125)
Browse files Browse the repository at this point in the history
Fix function bodyparser to bodyParser
  • Loading branch information
thaiworldgame committed Apr 17, 2020
1 parent 6862c7b commit e02cb7d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ app.use(async ctx => {
* **detectJSON**: custom json request detect function. Default is `null`.

```js
app.use(bodyparser({
app.use(bodyParser({
detectJSON: function (ctx) {
return /\.json$/i.test(ctx.path);
}
Expand All @@ -68,7 +68,7 @@ app.use(async ctx => {
* **extendTypes**: support extend types:

```js
app.use(bodyparser({
app.use(bodyParser({
extendTypes: {
json: ['application/x-javascript'] // will parse application/x-javascript type body as a JSON string
}
Expand All @@ -78,7 +78,7 @@ app.use(async ctx => {
* **onerror**: support custom error handle, if `koa-bodyparser` throw an error, you can customize the response like:

```js
app.use(bodyparser({
app.use(bodyParser({
onerror: function (err, ctx) {
ctx.throw('body parse error', 422);
}
Expand Down

0 comments on commit e02cb7d

Please sign in to comment.