Skip to content

Commit

Permalink
feat: Add redirection from / to /ui as homepage (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
Prnyself authored Aug 13, 2021
1 parent b83c731 commit 171ea10
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ func (s *Server) Start() error {
// register routers here
r.GET("/ping", ping)
r.StaticFS("/ui", http.FS(ui.UI))

// redirect / to /ui, since /ui is the real homepage of website
r.GET("/", func(c *gin.Context) {
c.Redirect(http.StatusFound, "/ui")
})

r.NoRoute(func(c *gin.Context) {
c.Status(http.StatusNotFound)
})
Expand Down

0 comments on commit 171ea10

Please sign in to comment.