From 62a3e598c68a6f34659debf9b6ec29b04ebee771 Mon Sep 17 00:00:00 2001 From: Kayra Date: Fri, 9 Aug 2024 17:00:31 +0300 Subject: [PATCH] refactor: redirect page in the frontend (#53) --- internal/api/handlers.go | 4 +--- ui/src/app/page.tsx | 7 +++++++ 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 ui/src/app/page.tsx diff --git a/internal/api/handlers.go b/internal/api/handlers.go index 2013487..c20db85 100644 --- a/internal/api/handlers.go +++ b/internal/api/handlers.go @@ -76,9 +76,7 @@ func newFrontendFileServer() http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { path := r.URL.Path - if strings.HasSuffix(path, "/") || path == "/" { - path = "/certificate_requests.html" - } else if !strings.Contains(path, ".") { + if !strings.HasSuffix(path, "/") && !strings.Contains(path, ".") { path += ".html" } r.URL.Path = path diff --git a/ui/src/app/page.tsx b/ui/src/app/page.tsx new file mode 100644 index 0000000..a38a591 --- /dev/null +++ b/ui/src/app/page.tsx @@ -0,0 +1,7 @@ +"use client" +import { useRouter } from "next/navigation" + +export default function FrontPage() { + const router = useRouter() + router.push("/certificate_requests") +} \ No newline at end of file