-
-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Just followed the read me and what was suggested by @MathurAditya724 .
and in reference to #10
Reproducible snippet
import Redis from 'ioredis';
import { env } from './env.util';
import { rateLimiter } from 'hono-rate-limiter';
import { generateId } from './crypto.util';
import { type Store } from 'hono-rate-limiter';
import { RedisStore } from 'rate-limit-redis';
const client = new Redis(env.REDIS_URL);
const limiter = rateLimiter({
windowMs: 15 * 60 * 1000,
limit: 100,
// Change the header according to your proxy
keyGenerator: (c) => c.req.header('X-Forwarded-for') + generateId(20),
store: new RedisStore({
sendCommand: (...args: string[]) => client.sendCommand(args)
}) as unknown as Store // Adding the correct type
});
export { client, limiter };
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working