Skip to content

How do I rate-limit some but not all endpoints? #25

@vgoklani

Description

@vgoklani

Hi - Thank you for taking the time to create this!

How do I protect multiple endpoints in express?

const rateLimiter = RateLimiter(app, app.locals.redisClient0);
rateLimiter({
    path: '/api/fetch',
    method: 'post',
    lookup: 'headers.x-forwarded-for',
    total: 120,
    expire: 1000 * 60 * 60
});

It seems like the path is a string, not an array. Please let me know - thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions