18 lines
364 B
Python
18 lines
364 B
Python
# main.py
|
|
from fastapi import FastAPI
|
|
import os, datetime
|
|
|
|
app = FastAPI()
|
|
|
|
@app.get("/health")
|
|
def health():
|
|
return {
|
|
"status": "ok",
|
|
"version": os.getenv("deployment.yaml", "dev"),
|
|
"timestamp": datetime.datetime.utcnow().isoformat()
|
|
}
|
|
|
|
@app.get("/")
|
|
def root():
|
|
return {"poruka": "Zdravo s k3s!", "host": os.uname().nodename}
|