Revert "fix home nav"

This reverts commit 2eb257c2a6.
This commit is contained in:
9qeklajc
2026-05-14 15:51:20 +02:00
parent 2eb257c2a6
commit e2143aa173
2 changed files with 3 additions and 31 deletions
+2 -15
View File
@@ -268,21 +268,8 @@ if UI_DIST_PATH.exists() and UI_DIST_PATH.is_dir():
)
@app.get("/", include_in_schema=False)
async def serve_root_ui() -> StarletteResponse:
index = UI_DIST_PATH / "index.html"
if index.exists():
return FileResponse(index)
# UI directory exists but the index page is missing — return a basic
# status payload so the home page never 404s.
from fastapi.responses import JSONResponse as _JSONResponse
return _JSONResponse(
{
"name": global_settings.name,
"version": __version__,
"status": "running",
}
)
async def serve_root_ui() -> FileResponse:
return FileResponse(UI_DIST_PATH / "index.html")
# Serve the App Router RSC payload for the home page.
@app.get("/index.txt", include_in_schema=False)
+1 -16
View File
@@ -2,7 +2,7 @@ import json
from typing import Any
from fastapi import APIRouter, Depends, HTTPException, Request
from fastapi.responses import JSONResponse, Response, StreamingResponse
from fastapi.responses import Response, StreamingResponse
from sqlmodel import select
from .algorithm import create_model_mappings
@@ -174,21 +174,6 @@ async def proxy(
# so that OpenAI-style endpoints work with or without the `v1/` prefix
# (e.g. `/chat/completions` as well as `/v1/chat/completions`).
if request.method == "GET" and not path.startswith(_API_PATH_PREFIXES):
# An empty path means the root `/` reached the catch-all because no
# explicit handler matched (e.g. the UI bundle is missing from the
# deploy). Return a small status payload instead of a 404 so that the
# home page never appears broken.
if not path:
from .core.version import __version__
return JSONResponse(
status_code=200,
content={
"name": settings.name,
"version": __version__,
"status": "running",
},
)
return build_not_found_response(request, path)
headers = dict(request.headers)