inspect_routes.py 634 B

12345678910111213141516171819
  1. import sys
  2. import os
  3. # Adjust sys.path to include the backend directory
  4. backend_dir = r"d:\radionica3d\backend"
  5. sys.path.append(backend_dir)
  6. os.chdir(backend_dir) # Change to backend dir to avoid import issues
  7. from main import app
  8. print("--- REGISTERED ROUTES ---")
  9. for route in app.routes:
  10. path = getattr(route, "path", None)
  11. name = getattr(route, "name", None)
  12. if path:
  13. print(f"Path: {path}, Name: {name}")
  14. elif hasattr(route, "routes"): # For mounted apps or groups
  15. for subroute in route.routes:
  16. subpath = getattr(subroute, "path", None)
  17. print(f"Group Path: {subpath}")