Files
manifesti/app/main.py
2026-04-30 22:25:30 +02:00

24 lines
439 B
Python

from fastapi import FastAPI
app = FastAPI()
_healthy = True # DODANO
@app.get("/")
def root():
return {"message": "Pozdrav svijete"}
@app.get("/health")
def health():
if not _healthy: # DODANO
return {"status": "unhealthy"}
return {"status": "ok"}
@app.post("/break") # DODANO
def break_health():
global _healthy
_healthy = False
return {"message": "Servis je sada nezdrav — ocekuj restart"}