Spaces:
Paused
Paused
Serve frontend HTML at root path
Browse files
app.py
CHANGED
|
@@ -113,6 +113,15 @@ except Exception as e:
|
|
| 113 |
for d in ["/data/frames", "/data/features", "/data/index", "/data/videos"]:
|
| 114 |
os.makedirs(d, exist_ok=True)
|
| 115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
@asynccontextmanager
|
| 117 |
async def lifespan(app: FastAPI):
|
| 118 |
async with engine.begin() as conn:
|
|
|
|
| 113 |
for d in ["/data/frames", "/data/features", "/data/index", "/data/videos"]:
|
| 114 |
os.makedirs(d, exist_ok=True)
|
| 115 |
|
| 116 |
+
# Serve static frontend
|
| 117 |
+
from fastapi.responses import HTMLResponse, FileResponse
|
| 118 |
+
from fastapi.staticfiles import StaticFiles
|
| 119 |
+
|
| 120 |
+
@app.get("/")
|
| 121 |
+
async def serve_frontend():
|
| 122 |
+
"""Serve the Eye-Dentify UI"""
|
| 123 |
+
return FileResponse("index.html")
|
| 124 |
+
|
| 125 |
@asynccontextmanager
|
| 126 |
async def lifespan(app: FastAPI):
|
| 127 |
async with engine.begin() as conn:
|