From 98feaa3e42661aded8cfed3c0067b41b2d5d8ab8 Mon Sep 17 00:00:00 2001 From: EvieePy Date: Mon, 6 May 2024 20:55:55 +1000 Subject: [PATCH] Add compat redirects --- core/server.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/server.py b/core/server.py index c715884..722e5b5 100644 --- a/core/server.py +++ b/core/server.py @@ -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( {