Spaces:
Sleeping
Sleeping
File size: 782 Bytes
5e0532d |
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 28 29 30 31 32 33 34 |
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")
@app.get("/health")
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)
|