Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
atian25 committed Nov 23, 2017
1 parent 42bbea5 commit 5b3a98c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
8 changes: 1 addition & 7 deletions docs/source/en/basics/middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,7 @@ module.exports = {

## Use Koa's Middleware

The framework is compatible with all kinds of middleware of Koa 1.x and 2.x, including:

- async function: `async (ctx, next) => {}`
- generator function: `function* (next) {}`
- common function: `(ctx, next) => {}`

All middleware used by Koa can be directly used by the framework, too.
Developer is free to use Koa Middleware, all middleware used by Koa can be directly used by the framework too.

For example, Koa uses [koa-compress](https://github.com/koajs/compress) in this way:

Expand Down
8 changes: 1 addition & 7 deletions docs/source/zh-cn/basics/middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,7 @@ module.exports = {

## 使用 Koa 的中间件

框架兼容 Koa 1.x 和 2.x 支持的所有形式的中间件,包括:

- async function: `async (ctx, next) => {}`
- generator function: `function* (next) {}`
- common function: `(ctx, next) => {}`

所有可以在 Koa 中使用的中间件都可以直接在框架中使用。
在框架里面可以非常容易的引入 Koa 中间件生态。

[koa-compress](https://github.com/koajs/compress) 为例,在 Koa 中使用时:

Expand Down

0 comments on commit 5b3a98c

Please sign in to comment.