Spaces:
Sleeping
Sleeping
Add debug logging for router imports
Browse files
server.py
CHANGED
|
@@ -78,9 +78,17 @@ for mod_path, name in (
|
|
| 78 |
("AISaas.app.main", "saas_router"),
|
| 79 |
):
|
| 80 |
try:
|
|
|
|
| 81 |
module = __import__(mod_path, fromlist=["router"]) # type: ignore
|
| 82 |
-
|
| 83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
pass
|
| 85 |
|
| 86 |
|
|
|
|
| 78 |
("AISaas.app.main", "saas_router"),
|
| 79 |
):
|
| 80 |
try:
|
| 81 |
+
print(f"Importing {mod_path}...")
|
| 82 |
module = __import__(mod_path, fromlist=["router"]) # type: ignore
|
| 83 |
+
router = getattr(module, "router")
|
| 84 |
+
print(f"Successfully imported {name}: {router}")
|
| 85 |
+
print(f"Router routes: {[route.path for route in router.routes]}")
|
| 86 |
+
app.include_router(router) # type: ignore
|
| 87 |
+
print(f"Successfully included {name}")
|
| 88 |
+
except Exception as e:
|
| 89 |
+
print(f"Failed to import {mod_path}: {e}")
|
| 90 |
+
import traceback
|
| 91 |
+
traceback.print_exc()
|
| 92 |
pass
|
| 93 |
|
| 94 |
|