Spaces:
Runtime error
Runtime error
File size: 728 Bytes
6fe3014 | 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 fastapi.middleware.cors import CORSMiddleware
from app.routes import forecast
from app.core.config import settings
app = FastAPI(title=settings.PROJECT_NAME)
# Set up CORS
app.add_middleware(
CORSMiddleware,
allow_origins=settings.CORS_ORIGINS,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
@app.get("/health")
async def health_check():
return {"status": "healthy", "service": settings.PROJECT_NAME}
# Include routes
app.include_router(forecast.router, prefix="/api", tags=["Forecast"])
if __name__ == "__main__":
import uvicorn
uvicorn.run("app.main:app", host=settings.HOST, port=settings.PORT, reload=True)
|