前端bug修复
This commit is contained in:
1 parent
adb780bc82
commit
ca2bc5f583
2 files changed
+17
No files matched your search
@@ -5,6 +5,7 @@ from contextlib import asynccontextmanager
|
||||
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.responses import RedirectResponse
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from starlette.exceptions import HTTPException as StarletteHTTPException
|
||||
from starlette.middleware.base import BaseHTTPMiddleware
|
||||
@@ -139,6 +140,14 @@ app.include_router(api_router)
|
||||
app.include_router(openapi_router)
|
||||
app.include_router(mcp_router)
|
||||
|
||||
|
||||
@app.get("/", include_in_schema=False)
|
||||
async def root_redirect() -> RedirectResponse:
|
||||
"""Send the public domain root to the bundled admin application."""
|
||||
|
||||
return RedirectResponse(url="/admin/", status_code=307)
|
||||
|
||||
|
||||
# Serve built admin-web SPA (when available)
|
||||
try:
|
||||
app.mount("/admin", SPAStaticFiles(directory="app/static/admin", html=True), name="admin-web")
|
||||
|
||||
Reference in new issue
Block a user