Spaces:
Sleeping
Sleeping
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| import uvicorn | |
| from app.core.config import settings | |
| from app.api import routes | |
| app = FastAPI( | |
| title=settings.PROJECT_NAME, | |
| version=settings.PROJECT_VERSION | |
| ) | |
| # CORS Configuration | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=settings.CORS_ORIGINS, | |
| allow_credentials=True, | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| # Register Routes | |
| app.include_router(routes.router, prefix="/api") | |
| async def health_check(): | |
| return { | |
| "status": "active", | |
| "service": "ORA-AI-Python", | |
| "model_target": settings.LLM_BASE_URL | |
| } | |
| if __name__ == "__main__": | |
| uvicorn.run("main:app", host=settings.HOST, port=settings.PORT, reload=True) | |