MCPcopy
hub / github.com/eggjs/examples / list

Method list

hackernews-datahub/app/controller/api.js:6–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5class NewsController extends Controller {
6 async list() {
7 const { ctx, app } = this;
8 const pageSize = app.config.news.pageSize;
9 const page = parseInt(ctx.query.page) || 1;
10
11 const idList = await ctx.service.hackerNews.getTopStories(page);
12
13 ctx.body = {
14 list: idList,
15 page, pageSize,
16 };
17 }
18}
19
20module.exports = NewsController;

Callers

nothing calls this directly

Calls 2

parseIntFunction · 0.50
getTopStoriesMethod · 0.45

Tested by

no test coverage detected