Skip to content

Commit 789dc3f

Browse files
committed
fix(docs): delete the legacy API docs page and drop a redirect hop
/api?old=1 still rendered the whole pre-Mintlify docs page: 200, 81KB, its own title, no noindex, and a canonical pointing at /api, which is itself a 301. So an orphaned copy of the docs stayed indexable and competed with the real ones for the same queries, and the page said in its own body that the docs had moved. The escape hatch and its template are gone, and the docs redirects now point at spoo.me/docs directly. docs.spoo.me still resolves but 301s there, so every redirect through it was costing a second hop.
1 parent 512d883 commit 789dc3f

3 files changed

Lines changed: 18 additions & 2253 deletions

File tree

routes/static_routes.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,29 +71,21 @@ async def favicon(request: Request) -> Response:
7171

7272
# ── Docs / legal ─────────────────────────────────────────────────────────────
7373

74+
# docs.spoo.me still resolves but 301s here, so pointing at it costs a hop.
75+
DOCS_ROOT = "https://spoo.me/docs"
76+
7477

7578
@router.get("/api")
7679
@limiter.exempt
7780
async def api_redirect(request: Request) -> Response:
78-
if request.query_params.get("old") == "1":
79-
return templates.TemplateResponse(
80-
request,
81-
"api.html",
82-
{
83-
"host_url": str(request.base_url),
84-
"self_promo": True,
85-
"self_promo_uri": "https://docs.spoo.me",
86-
"self_promo_text": "We have moved and revamped the docs to https://docs.spoo.me",
87-
},
88-
)
89-
return RedirectResponse("https://docs.spoo.me/introduction", status_code=301)
81+
return RedirectResponse(DOCS_ROOT + "/introduction", status_code=301)
9082

9183

9284
@router.get("/docs")
9385
@router.get("/docs/")
9486
@limiter.exempt
9587
async def docs_redirect(request: Request) -> Response:
96-
return RedirectResponse("https://docs.spoo.me", status_code=301)
88+
return RedirectResponse(DOCS_ROOT, status_code=301)
9789

9890

9991
@router.get("/docs/privacy-policy")
@@ -127,7 +119,7 @@ async def terms_of_service(request: Request) -> Response:
127119
@router.get("/docs/{path:path}")
128120
@limiter.exempt
129121
async def docs_wildcard(path: str, request: Request) -> Response:
130-
return RedirectResponse(f"https://docs.spoo.me/{path}", status_code=301)
122+
return RedirectResponse(f"{DOCS_ROOT}/{path}", status_code=301)
131123

132124

133125
# ── Contact ──────────────────────────────────────────────────────────────────

0 commit comments

Comments
 (0)