I want to rate limiter endpoint in my app with 10 requests per second. I have seen this question Ratelimit in Fastapi, but i cant understand how i should do in my project, because i have multiple files. My main.py
from .router import router
from fastapi import FastAPI
def get_application() -> FastAPI:
application = FastAPI()
application.include_router(router)
return application
app = get_application()
and router.py
from fastapi import APIRouter
router = APIRouter()
@router.get("/")
async def some_func(...):
#some code
So, how can i rate limiter my methods from router.py?