|
|
@@ -19,7 +19,6 @@ package main
|
|
|
import (
|
|
|
"fmt"
|
|
|
"net/http"
|
|
|
- "os"
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
|
|
|
@@ -42,7 +41,7 @@ func NewEtcdMuxer() *http.ServeMux {
|
|
|
etcdMux.Handle("/"+version+"/stats/", errorHandler(StatsHttpHandler))
|
|
|
etcdMux.Handle("/version", errorHandler(VersionHttpHandler))
|
|
|
etcdMux.HandleFunc("/test/", TestHttpHandler)
|
|
|
- etcdMux.Handle("/dashboard/", DashboardHttpHandler())
|
|
|
+ etcdMux.Handle("/mod/dashboard/", DashboardHttpHandler("/mod/dashboard/"))
|
|
|
return etcdMux
|
|
|
}
|
|
|
|
|
|
@@ -278,19 +277,6 @@ func GetHttpHandler(w http.ResponseWriter, req *http.Request) error {
|
|
|
|
|
|
}
|
|
|
|
|
|
-// DashboardHttpHandler either uses the compiled in virtual filesystem for the
|
|
|
-// dashboard assets or if ETCD_DASHBOARD_DIR is set uses that as the source of
|
|
|
-// assets.
|
|
|
-func DashboardHttpHandler() http.Handler {
|
|
|
- dashDir := os.Getenv("ETCD_DASHBOARD_DIR")
|
|
|
-
|
|
|
- if len(dashDir) == 0 {
|
|
|
- dashDir = "./"
|
|
|
- }
|
|
|
-
|
|
|
- return http.StripPrefix("/dashboard/", http.FileServer(http.Dir(dashDir)))
|
|
|
-}
|
|
|
-
|
|
|
// Watch handler
|
|
|
func WatchHttpHandler(w http.ResponseWriter, req *http.Request) error {
|
|
|
key := req.URL.Path[len("/v1/watch/"):]
|