Update app.py
Browse files/health end-point added
app.py
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
|
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
|
| 3 |
app = FastAPI()
|
| 4 |
|
| 5 |
@app.get("/")
|
| 6 |
def greet_json():
|
| 7 |
-
return {"Hello": "World!"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
#
|
| 3 |
from fastapi import FastAPI
|
| 4 |
|
| 5 |
app = FastAPI()
|
| 6 |
|
| 7 |
@app.get("/")
|
| 8 |
def greet_json():
|
| 9 |
+
return {"Hello": "World!", "cpu_count": os.cpu_count()}
|
| 10 |
+
|
| 11 |
+
@app.get("/health")
|
| 12 |
+
def health():
|
| 13 |
+
return "ok"
|