From d26cb35c5cfa9fe2beb930b556077429d2afff01 Mon Sep 17 00:00:00 2001 From: darkturtle Date: Thu, 29 Dec 2016 13:27:16 +0000 Subject: [PATCH] Doc: update README --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 15a3bc0..2d69959 100644 --- a/README.md +++ b/README.md @@ -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