From 0cc2b5fe576aff718470474264c8667bbd76f255 Mon Sep 17 00:00:00 2001 From: Aditya Gupta Date: Mon, 29 Jun 2026 17:49:37 +0530 Subject: [PATCH] feat: Setup CORS middleware and healthcheck --- app/main.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/main.py b/app/main.py index dca94d8..61b9e88 100644 --- a/app/main.py +++ b/app/main.py @@ -19,3 +19,14 @@ app = FastAPI( openapi_url=f"{settings.API_V1_STR}/openapi.json", lifespan=lifespan, ) +app.add_middleware( + CORSMiddleware, + allow_origins=["*"], + allow_credentials=True, + allow_methods=["*"], + allow_headers=["*"], +) +app.include_router(jobs_router, prefix=settings.API_V1_STR) +@app.get("/health", tags=["health"]) +def health_check(): + return {"status": "ok", "project": settings.PROJECT_NAME}