Skip to content

Commit

Permalink
Add compat redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
EvieePy committed May 6, 2024
1 parent dcca088 commit 98feaa3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,16 @@ def __init__(self, *, database: Database) -> None:
super().__init__(on_startup=[self.event_ready], views=views, routes=routes, middleware=middleware)

@starlette_plus.route("/docs")
@starlette_plus.route("/documentation")
async def documentation_redirect(self, request: starlette_plus.Request) -> starlette_plus.Response:
return starlette_plus.RedirectResponse("/api/documentation")

@starlette_plus.route("/documents")
@starlette_plus.route("/api/documents")
async def documents_redirect(self, request: starlette_plus.Request) -> starlette_plus.Response:
# Compat redirect route...
return starlette_plus.RedirectResponse("/api/paste", status_code=308)

async def event_ready(self) -> None:
self.schemas = SchemaGenerator(
{
Expand Down

0 comments on commit 98feaa3

Please sign in to comment.