Fix blank ReDoc by pinning stable redoc bundle
This commit is contained in:
@@ -8,6 +8,7 @@ from fastapi import FastAPI
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from fastapi.responses import FileResponse
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.openapi.docs import get_redoc_html
|
||||
from pathlib import Path
|
||||
import os
|
||||
|
||||
@@ -26,7 +27,7 @@ app = FastAPI(
|
||||
description="Dashboard per il monitoraggio dei modelli LLM in Ollama",
|
||||
version="1.0.0",
|
||||
docs_url="/docs",
|
||||
redoc_url="/redoc",
|
||||
redoc_url=None,
|
||||
openapi_url="/openapi.json"
|
||||
)
|
||||
|
||||
@@ -74,6 +75,17 @@ async def models_running_page():
|
||||
return FileResponse(templates_path / "models_running.html")
|
||||
|
||||
|
||||
@app.get("/redoc", include_in_schema=False)
|
||||
async def redoc_html():
|
||||
"""Documentazione ReDoc con bundle stabile (evita dipendenza da redoc@next)."""
|
||||
return get_redoc_html(
|
||||
openapi_url=app.openapi_url,
|
||||
title=f"{app.title} - ReDoc",
|
||||
redoc_js_url="https://cdn.jsdelivr.net/npm/redoc@2/bundles/redoc.standalone.js",
|
||||
with_google_fonts=False,
|
||||
)
|
||||
|
||||
|
||||
@app.get("/favicon.ico", include_in_schema=False)
|
||||
async def favicon():
|
||||
"""Favicon dell'applicazione."""
|
||||
|
||||
Reference in New Issue
Block a user