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: modify and fix 3 points #264

Merged
merged 2 commits into from
Jan 16, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions docs/source/zh-cn/intro/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $ npm i

```bash
$ npm run dev
$ open localhost:7001
$ open localhost:7001/home
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个地方不用改 home 了, boilerplate 那边我发 PR 修改了.
https://github.com/eggjs/egg-boilerplate-simple/pull/19/files

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

麻烦再改改, 然后可以合并了

```

## 逐步搭建
Expand Down Expand Up @@ -196,9 +196,9 @@ module.exports = app => {
// parallel GET detail, see `yield {}` from co
const newsList = yield Object.keys(idList).map(key => {
const url = `${serverUrl}/item/${idList[key]}.json`;
return this.ctx.curl(url, { dataType: 'json' }).then(res => res.data);
return this.ctx.curl(url, { dataType: 'json' });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@atian25 叫你不写单测。。。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-.-!!

return this.app.urllib.request(url, { dataType: 'json' }).then(res => res.data);

内网版之前这么写的, 我就随手简化了下... examples 那边没问题的.

});
return newsList;
return newsList.map(res => res.data);
}
}
return NewsService;
Expand All @@ -217,6 +217,15 @@ exports.list = function* newsList() {
yield this.render('news/list.tpl', { list: newsList });
};
```
还需增加app/service/news.js中读取到的配置:
Copy link
Member

@popomore popomore Jan 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文件路径加上代码块,还有空格


```js
// config/config.default.js
config.news = {
pageSize: 5,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里缩进错了

serverUrl: 'https://hacker-news.firebaseio.com/v0',
};
```

### 编写扩展

Expand Down