Skip to content

Commit

Permalink
docs: add tutorials index & fix async
Browse files Browse the repository at this point in the history
  • Loading branch information
atian25 committed Feb 13, 2017
1 parent d361abe commit 8e24aa6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/source/_data/menu.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
guide: /intro/
# api: /api
tutorials: /tutorials/mysql.html
tutorials: /tutorials/index.html
plugins: https://github.com/search?q=topic%3Aegg-plugin&type=Repositories
release: https://github.com/eggjs/egg/releases
2 changes: 1 addition & 1 deletion docs/source/zh-cn/tutorials/async-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ module.exports = {
框架中所有的中间件,包括[标准定义方式](../basics/middleware.md)以及在[路由中定义的中间件](../basics/router.md#中间件的使用)都可以通过 async function 来编写。但是和 generator function 格式的中间件稍有不同的是,中间件的参数列表变化了,和 koa v2.x 一样:

- 第一个参数为 `ctx`,代表当前请求的上下文,是 [Context](../basics/extend.md#Context) 的实例。
- 第二个参数为 `next`第二个参数为 `next`用 await 执行它来执行后续中间件的逻辑。
- 第二个参数为 `next`,用 await 执行它来执行后续中间件的逻辑。

```js
// app/middleware/gzip.js
Expand Down
7 changes: 7 additions & 0 deletions docs/source/zh-cn/tutorials/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: 教程
---

- [渐进式开发](./progressive.md)
- [MySQL](./mysql.md)
- [RESTful API](./restful.md)
- [Async Function](./async-function.md)

0 comments on commit 8e24aa6

Please sign in to comment.