Spaces:
Sleeping
Sleeping
| 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 | |
| async def root(): | |
| return {"message": "Hello from FastAPI"} | |
| #app.include_router(router) | |