aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/routes.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/routes.py b/app/routes.py
index da8a502..fa5ab57 100644
--- a/app/routes.py
+++ b/app/routes.py
@@ -1,5 +1,6 @@
import fastapi
from fastapi import Security, HTTPException, Request
+from starlette.responses import RedirectResponse
import pydantic
import sqlalchemy
@@ -191,4 +192,10 @@ async def link_delrecords(link: str, api_key: str = Security(check_api_key)):
detail="Link not associated with given API key"
)
else:
- return {"link": f"The records for link {data} have been deleted"} \ No newline at end of file
+ return {"link": f"The records for link {data} have been deleted"}
+
+
+# Redirect / -> /docs
+@app.get("/", summary="Redirect to the Swagger UI documentation")
+async def redirect_to_docs():
+ return RedirectResponse(url="/docs") \ No newline at end of file