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/209f7bbc2bf99db9bb04fdf5d62a2f2ca41bd622/routes/root.py
- Command line
-
hf download hf://spaces/NLP-Debater-Project/FastAPI-Backend-Models@209f7bbc2bf99db9bb04fdf5d62a2f2ca41bd622/routes/root.py
-
curl -L -o root.py https://huggingface.co/spaces/NLP-Debater-Project/FastAPI-Backend-Models/resolve/209f7bbc2bf99db9bb04fdf5d62a2f2ca41bd622/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") | |