Spaces:
Sleeping
Sleeping
File size: 1,028 Bytes
74711df | 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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | """FastAPI application and route definitions."""
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from src.api.routers import (
candidates_router,
ingest_router,
jobs_router,
matches_router,
tasks_router,
)
from src.core.config import get_settings
settings = get_settings()
app = FastAPI(title=settings.app_name)
# Enable CORS for local UI development
app.add_middleware(
CORSMiddleware,
allow_origins=["*"], # Adjust in production
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
# Include Routers
app.include_router(jobs_router, prefix="/api")
app.include_router(matches_router, prefix="/api")
app.include_router(candidates_router, prefix="/api")
app.include_router(ingest_router, prefix="/api")
app.include_router(tasks_router, prefix="/api")
@app.get("/health")
def health() -> dict[str, str]:
"""Runs health logic.
Returns:
dict[str, str]: Return value for this function.
"""
return {"status": "ok"}
|