From e806337503b457ef104f1ad8dea50b75679693e9 Mon Sep 17 00:00:00 2001 From: gilesb Date: Sun, 11 Jan 2026 18:05:24 +0000 Subject: [PATCH] Remove unnecessary redirect routes, fix template links - Removed /run/{id} and /recipe/{id} redirect routes - Updated templates to use /runs/ and /recipes/ paths Co-Authored-By: Claude Opus 4.5 --- app/__init__.py | 19 +------------------ app/templates/cache/detail.html | 2 +- app/templates/recipes/list.html | 2 +- app/templates/runs/_run_card.html | 2 +- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index 96aea6a..46a937b 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -65,26 +65,9 @@ def create_app() -> FastAPI: app.include_router(storage.router, prefix="/storage", tags=["storage"]) app.include_router(api.router, prefix="/api", tags=["api"]) - # Runs router - handles both /runs and /run/{id} patterns + # Runs and recipes routers app.include_router(runs.router, prefix="/runs", tags=["runs"]) - # Also mount at /run for single-run detail URLs - from fastapi import APIRouter - from .dependencies import get_run_service, get_recipe_service - run_detail_router = APIRouter() - @run_detail_router.get("/{run_id}") - async def run_detail_redirect(run_id: str, request: Request): - from .routers.runs import run_detail - return await run_detail(run_id, request, run_service=get_run_service()) - app.include_router(run_detail_router, prefix="/run", tags=["runs"]) - - # Recipes router - handles both /recipes and /recipe/{id} patterns app.include_router(recipes.router, prefix="/recipes", tags=["recipes"]) - recipe_detail_router = APIRouter() - @recipe_detail_router.get("/{recipe_id}") - async def recipe_detail_redirect(recipe_id: str, request: Request): - from .routers.recipes import get_recipe - return await get_recipe(recipe_id, request, recipe_service=get_recipe_service()) - app.include_router(recipe_detail_router, prefix="/recipe", tags=["recipes"]) # Cache router - handles /cache and /media app.include_router(cache.router, prefix="/cache", tags=["cache"]) diff --git a/app/templates/cache/detail.html b/app/templates/cache/detail.html index 5c8dd13..1eff930 100644 --- a/app/templates/cache/detail.html +++ b/app/templates/cache/detail.html @@ -79,7 +79,7 @@

Related Runs