We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4c56ad commit d058712Copy full SHA for d058712
app/main.py
@@ -4,7 +4,7 @@
4
from fastapi import APIRouter, FastAPI
5
from fastapi.middleware.cors import CORSMiddleware
6
7
-from app import lifespan_func
+from app import lifespan_func, logger
8
9
10
def scan_and_include_routers(app: FastAPI) -> None:
@@ -15,10 +15,8 @@ def scan_and_include_routers(app: FastAPI) -> None:
15
module = importlib.import_module(f"{package_module_name}.{module_name}")
16
for attr_name in dir(module):
17
attr = getattr(module, attr_name)
18
- if (
19
- isinstance(attr, APIRouter)
20
- and getattr(attr, "__module__", None) == module.__name__
21
- ):
+ if isinstance(attr, APIRouter):
+ logger.info(f"Including router from {module.__name__}")
22
app.include_router(attr)
23
24
0 commit comments