Skip to content

Latest commit

 

History

History
23 lines (13 loc) · 393 Bytes

README.md

File metadata and controls

23 lines (13 loc) · 393 Bytes

fastapi-rate-limit

Middleware for rate limit

Usage

from fastapi import FastAPI
from rate_limit import RateLimitMiddleware


app = FastAPI()

# Adiciona o middleware com limite de 100 requisições por 60 segundos
app.add_middleware(RateLimitMiddleware, max_requests=100, seconds=60)


@app.get("/")
async def root():
    return {"message": "Hello RateLimitMiddleware"}