Spaces:
Sleeping
Sleeping
Add root endpoint redirect to /docs
Browse files
src/personalization/api/main.py
CHANGED
|
@@ -89,6 +89,13 @@ async def lifespan(app: FastAPI):
|
|
| 89 |
|
| 90 |
app = FastAPI(title="Semantic Book Discovery Engine", lifespan=lifespan)
|
| 91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
# Add Prometheus Instrumentation
|
| 93 |
Instrumentator().instrument(app).expose(app)
|
| 94 |
|
|
|
|
| 89 |
|
| 90 |
app = FastAPI(title="Semantic Book Discovery Engine", lifespan=lifespan)
|
| 91 |
|
| 92 |
+
# Add a root endpoint to redirect to docs
|
| 93 |
+
from fastapi.responses import RedirectResponse
|
| 94 |
+
|
| 95 |
+
@app.get("/")
|
| 96 |
+
async def read_root():
|
| 97 |
+
return RedirectResponse(url="/docs")
|
| 98 |
+
|
| 99 |
# Add Prometheus Instrumentation
|
| 100 |
Instrumentator().instrument(app).expose(app)
|
| 101 |
|