File size: 687 Bytes
69e9d44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from fastapi import FastAPI
from app.api.endpoints import router
from fastapi.middleware.cors import CORSMiddleware

app = FastAPI(title="AI Query Generator")
# app.include_router(router)

# Allowed origins (Update this for production)

#router = APIRouter()
app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],  # Replace "*" with your frontend domain in production
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

# Include API routes from endpoints.py
app.include_router(router, prefix="/api")  # You can remove prefix if not needed

@app.get("/")
async def root():
    return {"message": "Hello from FastAPI"}

#app.include_router(router)