Files
zadaca/app/main.py
ITO Mac fe26dc1bcf .
2026-05-04 18:22:49 +02:00

22 lines
427 B
Python

import os
import signal
from fastapi import FastAPI
app = FastAPI()
_healthy = True
@app.get("/health")
def health():
if not _healthy:
return {"status": "unhealthy"}, 503
return {"status": "ok"}
@app.post("/break")
def break_health():
"""Simulira pad servisa za testiranje liveness probe-a"""
global _healthy
_healthy = False
return {"message": "Servis je sada nezdrav — ocekuj restart"}