diff --git a/server/server.go b/server/server.go index f8558a65..8e49a884 100644 --- a/server/server.go +++ b/server/server.go @@ -86,7 +86,7 @@ func (s *Server) Run(webRoot embed.FS, path string, debug bool) { engine.Use(AuthorizeMiddleware(s)) engine.Use(Recover) - engine.POST("test", s.TestHandle) + engine.POST("api/test", s.TestHandle) engine.GET("api/session/get", s.GetSessionHandle) engine.POST("api/login", s.LoginHandle) engine.POST("api/logout", s.LogoutHandle) @@ -116,6 +116,9 @@ func (s *Server) Run(webRoot embed.FS, path string, debug bool) { if c.Request.URL.Path == "/favicon.ico" { c.Redirect(http.StatusMovedPermanently, "/chat/"+c.Request.URL.Path) } + if c.Request.URL.Path == "/" { + c.Redirect(http.StatusMovedPermanently, "/chat") + } }) // process front-end web static files diff --git a/web/index.html b/web/public/index.html similarity index 53% rename from web/index.html rename to web/public/index.html index e8198492..d3d83a0b 100644 --- a/web/index.html +++ b/web/public/index.html @@ -5,19 +5,8 @@ - -