from fastapi import APIRouter, Request
from fastapi.responses import FileResponse
import os

router = APIRouter()
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
STATIC_PATH = os.path.join(BASE_DIR, "static")


@router.get("/")
async def read_index(request: Request):
    # This serves the static file directly
    return FileResponse(os.path.join(STATIC_PATH, 'index.html'))