Redirect / -> /docs

This commit is contained in:
Parker M. 2024-05-31 01:29:25 -05:00
parent bce756b9aa
commit a4107d0976
No known key found for this signature in database
GPG Key ID: 95CD2E0C7E329F2A

View File

@ -1,5 +1,6 @@
import fastapi import fastapi
from fastapi import Security, HTTPException, Request from fastapi import Security, HTTPException, Request
from starlette.responses import RedirectResponse
import pydantic import pydantic
import sqlalchemy import sqlalchemy
@ -192,3 +193,9 @@ async def link_delrecords(link: str, api_key: str = Security(check_api_key)):
) )
else: else:
return {"link": f"The records for link {data} have been deleted"} 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")