Spaces:
Sleeping
Sleeping
Add redirect from root to /docs
Browse files
src/book_recommender/api/main.py
CHANGED
|
@@ -132,6 +132,14 @@ async def add_security_headers(request: Request, call_next):
|
|
| 132 |
return response
|
| 133 |
|
| 134 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
@app.get(
|
| 136 |
"/health",
|
| 137 |
summary="Perform a health check",
|
|
|
|
| 132 |
return response
|
| 133 |
|
| 134 |
|
| 135 |
+
from fastapi.responses import RedirectResponse
|
| 136 |
+
|
| 137 |
+
@app.get("/", include_in_schema=False)
|
| 138 |
+
async def root():
|
| 139 |
+
"""Redirects to the API documentation."""
|
| 140 |
+
return RedirectResponse(url="/docs")
|
| 141 |
+
|
| 142 |
+
|
| 143 |
@app.get(
|
| 144 |
"/health",
|
| 145 |
summary="Perform a health check",
|