Added a health-check endpoint
This commit is contained in:
@@ -155,3 +155,7 @@ class Spool(BaseModel):
|
||||
lot_nr=item.lot_nr,
|
||||
comment=item.comment,
|
||||
)
|
||||
|
||||
|
||||
class HealthCheck(BaseModel):
|
||||
status: str = Field(example="healthy")
|
||||
|
||||
@@ -32,6 +32,13 @@ async def itemnotfounderror_exception_handler(_request: Request, exc: ItemNotFou
|
||||
)
|
||||
|
||||
|
||||
# Add health check endpoint
|
||||
@app.get("/health")
|
||||
async def health() -> models.HealthCheck:
|
||||
"""Return a health check."""
|
||||
return {"status": "healthy"}
|
||||
|
||||
|
||||
app.include_router(filament.router)
|
||||
app.include_router(spool.router)
|
||||
app.include_router(vendor.router)
|
||||
|
||||
Reference in New Issue
Block a user