from fastapi import FastAPI from starlette.middleware.cors import CORSMiddleware app = FastAPI(title="Sample FastAPI app", debug=False, version="1.0.0") app.add_middleware( CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) @app.get( path="/health", description="Health check" ) def health_check(): return {"status": "OK"}