api route fix
Browse files
server.py
CHANGED
|
@@ -10,7 +10,7 @@ from typing import List
|
|
| 10 |
|
| 11 |
import tempfile
|
| 12 |
from fastapi import FastAPI, File, Form, Request, UploadFile
|
| 13 |
-
from fastapi.responses import JSONResponse, StreamingResponse, Response, FileResponse
|
| 14 |
from fastapi.staticfiles import StaticFiles
|
| 15 |
from PIL import Image, ImageOps
|
| 16 |
import numpy as np
|
|
@@ -717,6 +717,21 @@ def health():
|
|
| 717 |
return {"ok": True, "boot_id": BOOT_ID}
|
| 718 |
|
| 719 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 720 |
@app.post("/api/sweeps/run/reset_status")
|
| 721 |
def reset_sweep_status():
|
| 722 |
pbc3_sweep.reset_status()
|
|
|
|
| 10 |
|
| 11 |
import tempfile
|
| 12 |
from fastapi import FastAPI, File, Form, Request, UploadFile
|
| 13 |
+
from fastapi.responses import JSONResponse, StreamingResponse, Response, FileResponse, PlainTextResponse
|
| 14 |
from fastapi.staticfiles import StaticFiles
|
| 15 |
from PIL import Image, ImageOps
|
| 16 |
import numpy as np
|
|
|
|
| 717 |
return {"ok": True, "boot_id": BOOT_ID}
|
| 718 |
|
| 719 |
|
| 720 |
+
@app.head("/")
|
| 721 |
+
def head_root():
|
| 722 |
+
return PlainTextResponse("")
|
| 723 |
+
|
| 724 |
+
|
| 725 |
+
@app.get("/healthz")
|
| 726 |
+
def healthz():
|
| 727 |
+
return PlainTextResponse("ok")
|
| 728 |
+
|
| 729 |
+
|
| 730 |
+
@app.head("/healthz")
|
| 731 |
+
def head_healthz():
|
| 732 |
+
return PlainTextResponse("")
|
| 733 |
+
|
| 734 |
+
|
| 735 |
@app.post("/api/sweeps/run/reset_status")
|
| 736 |
def reset_sweep_status():
|
| 737 |
pbc3_sweep.reset_status()
|