Files
helloo-cicdd/main.py
Marijanela 3b46662807
All checks were successful
CI/CD Pipeline / build (push) Successful in 1m27s
CI/CD Pipeline / deploy (push) Successful in 2m9s
new version 1.1
2026-04-30 17:34:02 +02:00

20 lines
432 B
Python

# main.py
from fastapi import FastAPI
import os, datetime
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"}