mirror of
https://github.com/pheralb/svgl.git
synced 2025-02-05 22:48:17 +08:00
⚙️ Update `too many request
` message
This commit is contained in:
parent
d43c572311
commit
51bb3462fc
@ -74,7 +74,7 @@ app.get('/', async (c) => {
|
||||
const { success } = await ratelimit.limit(ip ?? 'anonymous');
|
||||
|
||||
if (!success) {
|
||||
return c.json({ error: 'Too many request' }, 429);
|
||||
return c.json({ error: '🛑 Too many request' }, 429);
|
||||
}
|
||||
|
||||
if (limit) {
|
||||
@ -104,7 +104,7 @@ app.get('/categories', async (c) => {
|
||||
const { success } = await ratelimit.limit(ip ?? 'anonymous');
|
||||
|
||||
if (!success) {
|
||||
return c.json({ error: 'Too many request' }, 429);
|
||||
return c.json({ error: '🛑 Too many request' }, 429);
|
||||
}
|
||||
|
||||
const categoryTotals: Record<string, number> = {};
|
||||
@ -127,7 +127,7 @@ app.get('/categories', async (c) => {
|
||||
return c.json(categories);
|
||||
});
|
||||
|
||||
// 🌱 GET: "/category/:category - Return an list of svgs by specific category:
|
||||
// 🌱 GET: /category/:category - Return an list of svgs by specific category:
|
||||
app.get('/category/:category', async (c) => {
|
||||
const category = c.req.param('category') as string;
|
||||
const targetCategory = category.charAt(0).toUpperCase() + category.slice(1);
|
||||
@ -136,7 +136,7 @@ app.get('/category/:category', async (c) => {
|
||||
const { success } = await ratelimit.limit(ip ?? 'anonymous');
|
||||
|
||||
if (!success) {
|
||||
return c.json({ error: 'Too many request' }, 429);
|
||||
return c.json({ error: '🛑 Too many request' }, 429);
|
||||
}
|
||||
|
||||
const categorySvgs = fullRouteSvgsData.filter((svg) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user