update image to 1.1
This commit is contained in:
13
app/main.py
13
app/main.py
@@ -2,10 +2,23 @@ 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"}
|
||||
Reference in New Issue
Block a user