from slowapi import Limiter
from slowapi.util import get_remote_address
from app.core.config import settings

# Rate limiter using client IP address as key
# Can be disabled via RATE_LIMIT_ENABLED=false in .env
limiter = Limiter(
    key_func=get_remote_address,
    enabled=settings.RATE_LIMIT_ENABLED
)
