Skip to content

Commit 5b18791

Browse files
committed
📈 Add limiter endpoint
1 parent 465bf24 commit 5b18791

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎lib/router.js‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@ module.exports = app => {
2929
repos[key] = (repos[key].getTime() - new Date().getTime()) / 1000
3030
}
3131
}
32-
res.json({ repos, limiter: app.limiter.counts() })
32+
res.json(repos)
33+
})
34+
35+
routes.get('/limiter', async (req, res) => {
36+
if (req.query.key !== process.env.WEBHOOK_SECRET) {
37+
return res.status(403).end()
38+
}
39+
res.json(app.limiter.counts())
3340
})
3441

3542
routes.get('/badge/:type', async (req, res) => {

0 commit comments

Comments
 (0)