diff options
author | Parker <contact@pkrm.dev> | 2024-05-31 01:29:25 -0500 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2024-05-31 01:29:25 -0500 |
commit | a4107d097699b644f489be1403ff8e046a3af62a (patch) | |
tree | 77d0b34942b2156c4e04b0162f07532ec2cf3219 | |
parent | bce756b9aa51dfdfa2c2e6cdef4f88f660b80148 (diff) |
Redirect `/` -> `/docs`
-rw-r--r-- | app/routes.py | 9 |
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 |