feat api 调用次数记录
fix
This commit is contained in:
@@ -8,6 +8,7 @@ from fastapi import FastAPI
|
||||
|
||||
from app.api.api_route import router
|
||||
from app.core.config import settings
|
||||
from app.core.record_api_count import count_api_calls
|
||||
from app.schemas.response_template import ResponseModel
|
||||
from logging_env import LOGGER_CONFIG_DICT
|
||||
|
||||
@@ -34,6 +35,7 @@ def get_application() -> FastAPI:
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
application.middleware("http")(count_api_calls)
|
||||
application.include_router(router=router, prefix=settings.API_PREFIX)
|
||||
return application
|
||||
|
||||
|
||||
Reference in New Issue
Block a user