Skip to content

Commit

Permalink
Add fallback default value to README
Browse files Browse the repository at this point in the history
  • Loading branch information
venables committed Mar 4, 2017
1 parent fc60296 commit 3971f2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ npm install koa-json-body --save
Options
-------

* `fallback` - when set to `true`, `ctx.request.body` will always contain `{}` upon missing or invalid payloads.
* `fallback` - when set to `true`, `ctx.request.body` will always contain `{}` upon missing or invalid payloads. (default: `false`)
* `limit` - number or string representing the request size limit (default: `1mb`)
* `strict` - when set to `true`, koa-json-body will only accept arrays and objects. (default: `true`)

Expand All @@ -48,7 +48,7 @@ On a every route:
```javascript
const body = require('koa-json-body')

app.use(body({ limit: '10kb' }))
app.use(body({ limit: '10kb', fallback: true }))

app.use((ctx, next) => {
console.log(ctx.request.body)
Expand Down

0 comments on commit 3971f2e

Please sign in to comment.