(fix) /routes endpoint

This commit is contained in:
ishaan-jaff 2024-01-31 15:42:08 -08:00
parent 90eb50ddd3
commit 901fe6b40d

View file

@ -3836,10 +3836,12 @@ async def get_routes():
routes = [] routes = []
for route in app.routes: for route in app.routes:
route_info = { route_info = {
"path": route.path, "path": getattr(route, "path", None),
"methods": route.methods, "methods": getattr(route, "methods", None),
"name": route.name, "name": getattr(route, "name", None),
"endpoint": route.endpoint.__name__ if route.endpoint else None, "endpoint": getattr(route, "endpoint", None).__name__
if getattr(route, "endpoint", None)
else None,
} }
routes.append(route_info) routes.append(route_info)