Yassine Mhirsi
Redirect root endpoint to API documentation instead of returning API information
b0001af Download routes/root.py from NLP-Debater-Project/FastAPI-Backend-Models: direct link, hf CLI and curl.
- Browser
- Download file 289 Bytes
-
https://huggingface.co/spaces/NLP-Debater-Project/FastAPI-Backend-Models/resolve/c7fc3b6a98e2352a59ea488b608193eed0c8a3d3/routes/root.py
- Command line
-
hf download hf://spaces/NLP-Debater-Project/FastAPI-Backend-Models@c7fc3b6a98e2352a59ea488b608193eed0c8a3d3/routes/root.py
-
curl -L -o root.py https://huggingface.co/spaces/NLP-Debater-Project/FastAPI-Backend-Models/resolve/c7fc3b6a98e2352a59ea488b608193eed0c8a3d3/routes/root.py
289 Bytes
| """Root endpoint for API information""" | |
| from fastapi import APIRouter | |
| from fastapi.responses import RedirectResponse | |
| router = APIRouter() | |
| async def root(): | |
| """Redirect root to API documentation""" | |
| return RedirectResponse(url="/docs") | |