diff --git a/app/main.py b/app/main.py index a049a66..a6a0f2a 100644 --- a/app/main.py +++ b/app/main.py @@ -7,6 +7,7 @@ import logging from fastapi import FastAPI, HTTPException, Depends from fastapi.staticfiles import StaticFiles from fastapi.responses import HTMLResponse +from fastapi.middleware.cors import CORSMiddleware from contextlib import asynccontextmanager from app.core.config import settings @@ -50,6 +51,15 @@ app = FastAPI( lifespan=lifespan ) +# Add CORS middleware +app.add_middleware( + CORSMiddleware, + allow_origins=["*"], # Allow all origins + allow_credentials=True, + allow_methods=["*"], # Allow all methods + allow_headers=["*"], # Allow all headers +) + # Include API routes app.include_router(api_router, prefix="/api/v1") diff --git a/app/static/index.html b/app/static/index.html index 40b390c..9fef017 100644 --- a/app/static/index.html +++ b/app/static/index.html @@ -1654,7 +1654,7 @@ hideMessages(); try { - const response = await fetch('/api/v1/cluster/status'); + const response = await fetch('/api/v1/cluster-health'); if (!response.ok) { throw new Error(`HTTP ${response.status}: ${response.statusText}`); }