import sys
import os
# Adjust sys.path to include the backend directory
backend_dir = r"d:\radionica3d\backend"
sys.path.append(backend_dir)
os.chdir(backend_dir) # Change to backend dir to avoid import issues

from main import app

print("--- REGISTERED ROUTES ---")
for route in app.routes:
    path = getattr(route, "path", None)
    name = getattr(route, "name", None)
    if path:
        print(f"Path: {path}, Name: {name}")
    elif hasattr(route, "routes"): # For mounted apps or groups
         for subroute in route.routes:
             subpath = getattr(subroute, "path", None)
             print(f"Group Path: {subpath}")
