MuhammadHafizFassya's picture
Upload 10 files
6fe3014 verified
raw
history blame contribute delete
728 Bytes
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)