Aman Khare commited on
Commit ·
cc42e0f
1
Parent(s): e111c7f
Add root route redirect to swagger docs so users don't see 404
Browse files- server/app.py +7 -0
server/app.py
CHANGED
|
@@ -42,5 +42,12 @@
|
|
| 42 |
version="0.1.0",
|
| 43 |
)
|
| 44 |
|
|
|
|
|
|
|
| 45 |
# Mount all routes at root (/)
|
| 46 |
app.include_router(router)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
version="0.1.0",
|
| 43 |
)
|
| 44 |
|
| 45 |
+
from fastapi.responses import RedirectResponse
|
| 46 |
+
|
| 47 |
# Mount all routes at root (/)
|
| 48 |
app.include_router(router)
|
| 49 |
+
|
| 50 |
+
@app.get("/", include_in_schema=False)
|
| 51 |
+
async def root():
|
| 52 |
+
"""Redirect to the FastAPI interactive documentation."""
|
| 53 |
+
return RedirectResponse(url="/docs")
|