import sys
import os
# Add backend to path
backend_dir = os.path.abspath(os.path.join(os.getcwd(), "..", "backend"))
sys.path.append(backend_dir)
os.chdir(backend_dir)

# Mock some env vars if needed
os.environ["PORT"] = "5000"
os.environ["JWT_SECRET"] = "test"

try:
    from server import app
    from fastapi.routing import APIRoute
    for route in app.routes:
        if isinstance(route, APIRoute):
            print(f"{route.methods} {route.path}")
        else:
            print(f"OTHER {route.path if hasattr(route, 'path') else str(route)}")
except Exception as e:
    print(f"Error: {e}")
    import traceback
    traceback.print_exc()
