feat(real-data): carga dinamica de workstations y tickets/movimientos reales desde SQL Server
This commit is contained in:
+10
-3
@@ -48,9 +48,16 @@ async def health_check():
|
||||
)
|
||||
|
||||
|
||||
@app.get("/", tags=["Información"], summary="Información del servicio")
|
||||
async def root():
|
||||
"""Ruta raíz informativa."""
|
||||
from fastapi import Request
|
||||
from fastapi.responses import FileResponse
|
||||
|
||||
@app.get("/", tags=["Información"], summary="Interfaz Web o Información del servicio")
|
||||
async def root(request: Request):
|
||||
"""Sirve la aplicación React SPA si está compilada, o metadata JSON."""
|
||||
accept = request.headers.get("accept", "")
|
||||
frontend_index = Path(__file__).resolve().parent.parent.parent / "frontend" / "dist" / "index.html"
|
||||
if "text/html" in accept and frontend_index.is_file():
|
||||
return FileResponse(frontend_index)
|
||||
return {
|
||||
"app": __app_name__,
|
||||
"version": __version__,
|
||||
|
||||
Reference in New Issue
Block a user