Skip to content

Commit

Permalink
Doc: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
darkturtle committed Dec 29, 2016
1 parent c0124ca commit e53b5b9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,22 @@ npm install koa-methodoverride
var app = require('koa')();
var methodOverride = require('koa-methodoverride');

app.use(methodOverride());
app.use(methodOverride('_method'));

app.listen(3000);
```

This package leverages [async-busboy](https://github.com/m4nuC/async-busboy) for `multipart/formdata` enctype.
For those who want to read files and fields in this case, a new helper method `ctx.req.getAsyncBusboyBody()` is exposed.
Thus, instead of
```js
const { files, fields } = await asyncBusboy(ctx.req);
```
, you need to use
```js
const { files, fields } = await ctx.req.getAsyncBusboyBody();
```


### License

Expand Down

0 comments on commit e53b5b9

Please sign in to comment.