Skip to content

Commit

Permalink
refactor: redirect page in the frontend (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
kayra1 committed Aug 9, 2024
1 parent 1c4afd7 commit 62a3e59
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 1 addition & 3 deletions internal/api/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions ui/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"use client"
import { useRouter } from "next/navigation"

export default function FrontPage() {
const router = useRouter()
router.push("/certificate_requests")
}

0 comments on commit 62a3e59

Please sign in to comment.