Kamixitong/check_routes.py
2025-11-12 15:11:05 +08:00

14 lines
353 B
Python

from app import create_app
app = create_app()
print("API routes:")
routes = []
for rule in app.url_map.iter_rules():
methods = rule.methods if rule.methods else set()
routes.append((rule.rule, ','.join(sorted(methods)), rule.endpoint))
routes.sort()
for r in routes:
if r[2].startswith('api'):
print(f'{r[0]:30} {r[1]:20} {r[2]}')