diff --git a/src/app/views/__init__.py b/src/app/views/__init__.py index b7f613d..89490db 100644 --- a/src/app/views/__init__.py +++ b/src/app/views/__init__.py @@ -4,9 +4,14 @@ from .languages import languages_router from .users import users_router -__all__ = [ - "healthcheck_router", - "languages_router", - "users_router", - "donation_notifications_router", +routers = [ + donation_notifications_router, + healthcheck_router, + languages_router, + users_router, +] + + +__all__ = [ + "routers", ] diff --git a/src/core/app.py b/src/core/app.py index 0f174fb..65907f5 100644 --- a/src/core/app.py +++ b/src/core/app.py @@ -5,7 +5,7 @@ from fastapi_pagination import add_pagination from prometheus_fastapi_instrumentator import Instrumentator from redis import asyncio as aioredis -from app.views import healthcheck_router, languages_router, users_router +from app.views import routers from core.config import env_config from core.db import database @@ -13,9 +13,8 @@ from core.db import database def start_app() -> FastAPI: app = FastAPI(default_response_class=ORJSONResponse) - app.include_router(users_router) - app.include_router(languages_router) - app.include_router(healthcheck_router) + for router in routers: + app.include_router(router) app.state.database = database