Skip to content

Commit bb1b7bf

Browse files
committed
Documented custom middleware.
1 parent cac0d69 commit bb1b7bf

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- Renamed the `File` input type `Upload` for clarity.
1010
- Wording and formatting improvements.
1111
- Covered React Native.
12+
- Documented custom middleware.
1213

1314
## 2.0.2
1415

readme.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ npm install apollo-upload-server
2121

2222
Add the server middleware just before [graphql-server](https://github.com/apollographql/graphql-server).
2323

24-
For [Express](http://expressjs.com):
24+
#### [Express](http://expressjs.com)
2525

2626
```js
2727
import { apolloUploadExpress } from 'apollo-upload-server'
@@ -41,7 +41,7 @@ app.use(
4141
//
4242
```
4343

44-
For [Koa](http://koajs.com):
44+
#### [Koa](http://koajs.com)
4545

4646
```js
4747
import { apolloUploadKoa } from 'apollo-upload-server'
@@ -60,6 +60,14 @@ router.post(
6060
//
6161
```
6262

63+
#### Custom middleware
64+
65+
If the middleware you need is not available, import the asynchronous function `processRequest` to make your own:
66+
67+
```js
68+
import { processRequest } from 'apollo-upload-server'
69+
```
70+
6371
### GraphQL schema
6472

6573
Add an input type for uploads to your schema. You can name it anything but it must have this shape:

0 commit comments

Comments
 (0)