Files
helloo-cicdd/main.py
Marijanela c75f3b344c
All checks were successful
CI/CD Pipeline / build (push) Successful in 1m30s
CI/CD Pipeline / deploy (push) Successful in 1m59s
dodavanje jos jedne rute
2026-05-02 08:36:58 +02:00

24 lines
515 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.get("/")
def root():
return {"message":"Hello iz mog Docker containere"}
@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"}