Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(api): add app.use chainability note #1449

Merged
merged 1 commit into from Apr 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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