init: helloo-cicdd project setup
This commit is contained in:
18
main.py
Normal file
18
main.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# main.py
|
||||
from fastapi import FastAPI
|
||||
import os, datetime
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
@app.get("/health")
|
||||
def health():
|
||||
return {
|
||||
"status": "ok",
|
||||
"version": os.getenv("APP_VERSION", "dev"),
|
||||
"timestamp": datetime.datetime.utcnow().isoformat()
|
||||
}
|
||||
|
||||
@app.get("/")
|
||||
def root():
|
||||
return {"poruka": "Zdravo s k3s!", "host": os.uname().nodename}
|
||||
|
||||
Reference in New Issue
Block a user