semantics update

This commit is contained in:
2026-01-13 09:11:27 +03:00
parent 9a9c5879e6
commit ae1d630ad6
21 changed files with 4389 additions and 3471 deletions

View File

@@ -11,7 +11,7 @@ from pathlib import Path
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from fastapi import FastAPI, WebSocket, WebSocketDisconnect, Depends, Request
from fastapi import FastAPI, WebSocket, WebSocketDisconnect, Depends, Request, HTTPException
from fastapi.middleware.cors import CORSMiddleware
from fastapi.staticfiles import StaticFiles
from fastapi.responses import FileResponse
@@ -138,6 +138,10 @@ if frontend_path.exists():
# Serve other static files from the root of build directory
@app.get("/{file_path:path}")
async def serve_spa(file_path: str):
# Don't serve SPA for API routes that fell through
if file_path.startswith("api/"):
raise HTTPException(status_code=404, detail="API endpoint not found")
full_path = frontend_path / file_path
if full_path.is_file():
return FileResponse(str(full_path))