feat: Refactor endpoint listing into blueprint

- Moved endpoint listing and searching routes (`list_endpoints`, `search_endpoints`) and helper function (`get_routes`) from `app.py` into a new blueprint at `routes/endpoints.py`.
- Added `/endpoints` URL prefix to the blueprint.
- Registered the new `endpoints_bp` blueprint in `app.py`.
- Removed the original endpoint route definitions and helper function from `app.py`.
- Updated `url_for` calls in relevant templates (`endpoints.html`, `base.html`) to reference the new blueprint endpoints (e.g., `endpoints.list_endpoints`).
- Updated `templates/changelog/changelog.html` to document this refactoring.
```
This commit is contained in:
Peter Stockings
2025-03-31 23:15:24 +11:00
parent a8fe28339b
commit b875b49eca
5 changed files with 75 additions and 50 deletions

View File

@@ -11,7 +11,7 @@
<!-- Optional: Search or Filter functionality with HTMX -->
<div class="mb-4">
<input type="text" id="search" name="search" placeholder="Search endpoints..."
class="w-full p-2 border border-gray-300 rounded" hx-get="{{ url_for('search_endpoints') }}"
class="w-full p-2 border border-gray-300 rounded" hx-get="{{ url_for('endpoints.search_endpoints') }}"
hx-trigger="keyup changed delay:500ms, search" hx-push-url="true" hx-target="#endpoints-table"
hx-include="[name='search']">
</div>