Skip to content
This repository was archived by the owner on May 11, 2025. It is now read-only.

Commit 4255580

Browse files
committed
0.9
1 parent ab821c5 commit 4255580

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

index.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,16 @@ app.get('/:user/', async function (req, res) {
3535
res.send('permission denied');
3636
return;
3737
}
38-
const response = await cache.requestWithCache(`/users/${username}/repos`);
39-
const result = await langStatistics(Object.values(response).map(async (resp) => {
40-
return await getLanguage(username, resp['name']);
41-
}));
42-
res.send(result);
38+
const response = await cache.requestWithCache(`/users/${username}`);
39+
res.send({
40+
followers: response['followers'],
41+
repos: response['public_repos'],
42+
langs: await langStatistics(
43+
Object.values(await cache.requestWithCache(`/users/${username}/repos`)
44+
).map(async (resp) => {
45+
return await getLanguage(username, resp['name']);
46+
})),
47+
});
4348
});
4449

4550
app.get('/:user/:repo/', async function (req, res) {
@@ -57,7 +62,7 @@ app.get('/:user/:repo/', async function (req, res) {
5762
watchers: info['watchers_count'],
5863
license: info['license']['spdx_id'],
5964
langs: await getLanguage(username, repo),
60-
releases: (await cache.requestWithCache(`/repos/${username}/${repo}/releases`)).length,
65+
// releases: (await cache.requestWithCache(`/repos/${username}/${repo}/releases`)).length, - 700ms
6166
});
6267
});
6368

0 commit comments

Comments
 (0)