1
0
Fork 0
forked from sr2/cloud-api

feat: endpoint list producer

This commit is contained in:
Chris Milne 2026-06-03 11:57:18 +01:00
parent af680dbc38
commit 905fcf8814
2 changed files with 26 additions and 0 deletions

3
.gitignore vendored
View file

@ -205,3 +205,6 @@ cython_debug/
marimo/_static/
marimo/_lsp/
__marimo__/
endpoints.txt

View file

@ -66,3 +66,26 @@ def _seed(db):
db.flush()
group_model.user_rel.append(user_model)
db.commit()
# # Produces a text file with method and path for every endpoint in the API
# from fastapi.routing import APIRoute
#
# def get_testable_routes():
# routes = []
#
# for route in app.routes:
# if not isinstance(route, APIRoute):
# continue
#
# for method in route.methods:
# if method in {"HEAD", "OPTIONS"}:
# continue
#
# routes.append((route.path, method))
#
# return routes
#
#
# with open("endpoints.txt", "w") as f:
# for ep in get_testable_routes():
# f.write(f"{ep[1]} {ep[0]}\n")