use our own serve mux that directs how we want

This commit is contained in:
deads2k
2017-04-13 15:25:17 -04:00
parent fcd9b7f7ba
commit c837c7fb1a
14 changed files with 244 additions and 128 deletions

View File

@@ -28,7 +28,9 @@ const dashboardPath = "/api/v1/namespaces/kube-system/services/kubernetes-dashbo
type UIRedirect struct{}
func (r UIRedirect) Install(c *mux.PathRecorderMux) {
c.HandleFunc("/ui/", func(w http.ResponseWriter, r *http.Request) {
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, dashboardPath, http.StatusTemporaryRedirect)
})
c.Handle("/ui", handler)
c.HandlePrefix("/ui/", handler)
}