Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,15 @@
|
|
| 1 |
-
from fastapi import FastAPI
|
| 2 |
|
| 3 |
app = FastAPI()
|
| 4 |
|
| 5 |
@app.get("/")
|
| 6 |
def greet_json():
|
| 7 |
-
return {"Hello": "World!"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import FastAPI, Response
|
| 2 |
|
| 3 |
app = FastAPI()
|
| 4 |
|
| 5 |
@app.get("/")
|
| 6 |
def greet_json():
|
| 7 |
+
return {"Hello": "World!"}
|
| 8 |
+
|
| 9 |
+
@app.get("/health")
|
| 10 |
+
def health():
|
| 11 |
+
return {"ok": True}
|
| 12 |
+
|
| 13 |
+
@app.head("/health")
|
| 14 |
+
def health_head():
|
| 15 |
+
return Response(status_code=200)
|