diff --git a/README.md b/README.md index d287cea..4d368a1 100644 --- a/README.md +++ b/README.md @@ -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); } @@ -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 } @@ -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); }