Skip to content

Commit 9366b1d

Browse files
committed
feat: redirect to chat from the root path
1 parent 79b3101 commit 9366b1d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/httpapi/server.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ func (s *Server) registerRoutes(chatBasePath string) {
155155
"screen": ScreenUpdateBody{},
156156
}, s.subscribeScreen)
157157

158+
s.router.Handle("/", http.HandlerFunc(s.redirectToChat))
159+
158160
// Serve static files for the chat interface under /chat
159161
s.registerStaticFileRoutes(chatBasePath)
160162
}
@@ -310,3 +312,7 @@ func (s *Server) registerStaticFileRoutes(chatBasePath string) {
310312
s.router.Handle("/chat", http.StripPrefix("/chat", chatHandler))
311313
s.router.Handle("/chat/*", http.StripPrefix("/chat", chatHandler))
312314
}
315+
316+
func (s *Server) redirectToChat(w http.ResponseWriter, r *http.Request) {
317+
http.Redirect(w, r, "/chat", http.StatusTemporaryRedirect)
318+
}

0 commit comments

Comments
 (0)