Skip to content

Commit

Permalink
docs(api): add app.use chainability note (#1449)
Browse files Browse the repository at this point in the history
  • Loading branch information
zacanger committed Apr 25, 2020
1 parent 8ddab48 commit 6b6b0dd
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion docs/api/index.md
Expand Up @@ -175,7 +175,21 @@ https.createServer(app.callback()).listen(3001);

## app.use(function)

Add the given middleware function to this application. See [Middleware](https://github.com/koajs/koa/wiki#middleware) for
Add the given middleware function to this application.
`app.use()` returns `this`, so is chainable.
```js
app.use(someMiddleware)
app.use(someOtherMiddleware)
app.listen(3000)
```
Is the same as
```js
app.use(someMiddleware)
.use(someOtherMiddleware)
.listen(3000)
```

See [Middleware](https://github.com/koajs/koa/wiki#middleware) for
more information.

## app.keys=
Expand Down

0 comments on commit 6b6b0dd

Please sign in to comment.