Spaces:
Sleeping
Sleeping
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| from app.api.endpoints import router as api_router | |
| from app.core.config import settings | |
| app = FastAPI( | |
| title="Indian Financial Compliance API", | |
| description="API for Indian financial compliance analysis and stock data", | |
| version="1.0.0" | |
| ) | |
| # Configure CORS | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=["*"], # In production, replace with your Streamlit app URL | |
| allow_credentials=True, | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| # Include API router | |
| app.include_router(api_router, prefix="/api/v1") | |
| async def root(): | |
| return {"message": "Indian Financial Compliance API"} | |
| async def health_check(): | |
| return {"status": "healthy", "api_key_configured": bool(settings.API_KEY)} |