25 lines
576 B
Python
25 lines
576 B
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from app.routers import ingest, query
|
|
from app.core.config import get_settings
|
|
|
|
settings = get_settings()
|
|
app = FastAPI(title="RAG Video Q&A", version="1.0.0")
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=settings.cors_origins,
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
app.include_router(ingest.router, prefix="/api/v1")
|
|
app.include_router(query.router, prefix="/api/v1")
|
|
|
|
|
|
@app.get("/health")
|
|
def health_check():
|
|
return {"status": "ok"}
|