Skip to content

Commit

Permalink
Merge pull request #210 from calyptia/tp/redirect-vivo-base-path
Browse files Browse the repository at this point in the history
Redirect "/" to vivo base path
  • Loading branch information
tchrono authored Sep 28, 2023
2 parents 9c3f715 + 626aeb5 commit 013b383
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/service/vivo.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ func VivoListen(frontendStaticDir string, basePath string) {
basePath += "/"
fs := http.StripPrefix(basePath, http.FileServer(http.Dir(frontendStaticDir)))
http.Handle(basePath, fs)
if basePath != "/" {
// redirect "/" to base path
http.Handle("/", http.RedirectHandler(basePath, http.StatusSeeOther))
}
http.HandleFunc(basePath+"logs", vivoForward)
http.HandleFunc(basePath+"metrics", vivoForward)
http.HandleFunc(basePath+"traces", vivoForward)
Expand Down

0 comments on commit 013b383

Please sign in to comment.