main.py
This commit is contained in:
@@ -11,18 +11,12 @@ def root():
|
|||||||
return {"message": "Pozdrav svijete"}
|
return {"message": "Pozdrav svijete"}
|
||||||
|
|
||||||
|
|
||||||
# 🔥 HEALTH CHECK (BITNO: HTTP STATUS se mijenja)
|
|
||||||
@app.get("/health")
|
@app.get("/health")
|
||||||
def health():
|
def health():
|
||||||
if not _healthy:
|
if not _healthy:
|
||||||
return JSONResponse(
|
return JSONResponse(status_code=500, content={"status": "unhealthy"})
|
||||||
status_code=500,
|
|
||||||
content={"status": "unhealthy"}
|
|
||||||
)
|
|
||||||
return {"status": "ok"}
|
return {"status": "ok"}
|
||||||
|
|
||||||
|
|
||||||
# 🔥 BREAK ENDPOINT (simulira kvar)
|
|
||||||
@app.post("/break")
|
@app.post("/break")
|
||||||
def break_health():
|
def break_health():
|
||||||
global _healthy
|
global _healthy
|
||||||
|
|||||||
Reference in New Issue
Block a user