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

Commit ab821c5

Browse files
committed
0.8
1 parent 9f32da5 commit ab821c5

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

index.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,26 @@ app.get('/:user/', async function (req, res) {
4040
return await getLanguage(username, resp['name']);
4141
}));
4242
res.send(result);
43-
})
43+
});
4444

4545
app.get('/:user/:repo/', async function (req, res) {
4646
const username = req.params['user'], repo = req.params['repo'];
4747
if ( ! isAvailableUser(username) ) {
4848
res.send('permission denied');
4949
return;
5050
}
51-
const resp = await cache.requestWithCache(`/repos/${username}/${repo}`);
51+
const info = await cache.requestWithCache(`/repos/${username}/${repo}`);
5252

5353
res.send({
54-
size: utils.storeConvert(resp['size'], 1),
54+
size: utils.storeConvert(info['size'], 1),
55+
forks: info['forks'],
56+
stars: info['stargazers_count'],
57+
watchers: info['watchers_count'],
58+
license: info['license']['spdx_id'],
5559
langs: await getLanguage(username, repo),
60+
releases: (await cache.requestWithCache(`/repos/${username}/${repo}/releases`)).length,
5661
});
57-
})
62+
});
5863

5964

6065
app.listen(conf.port);

0 commit comments

Comments
 (0)