WayrApp Backend & Ecosystem Documentation - v1.0.0
    Preparing search index...

    Variable defaultRateLimiterConst

    defaultRateLimiter: RateLimitRequestHandler = ...

    Default Rate Limiter for General API Endpoints

    Pre-configured rate limiter for general API usage with moderate restrictions. Applied globally to all routes in the main application to prevent abuse while allowing normal usage patterns. Configuration values are read from environment variables to allow deployment-specific tuning.

    Rate limiting middleware for general API usage

    // Usage in main application (automatically applied to all routes)
    import { defaultRateLimiter } from '@/shared/middleware/security';

    if (process.env.NODE_ENV !== 'test') {
    app.use(defaultRateLimiter);
    }
    // Environment variable configuration
    // .env file
    RATE_LIMIT_WINDOW_MS=900000 # 15 minutes
    RATE_LIMIT_MAX_REQUESTS=100 # 100 requests per window