Exemple #1
0
func HttpHandler(addr string) http.Handler {
	r := mux.NewRouter()
	r.HandleFunc("/dashboard", addSlash)
	r.PathPrefix("/dashboard/").Handler(http.StripPrefix("/dashboard/", dashboard.HttpHandler()))

	r.PathPrefix("/v2/lock").Handler(http.StripPrefix("/v2/lock", lock2.NewHandler(addr)))
	r.PathPrefix("/v2/leader").Handler(http.StripPrefix("/v2/leader", leader2.NewHandler(addr)))
	return r
}
Exemple #2
0
func init() {
	// TODO: Use a Gorilla mux to handle this in 0.2 and remove the strip
	handler := http.StripPrefix("/etcd/mod/dashboard/", dashboard.HttpHandler())
	ServeMux = &handler
}
Exemple #3
0
func HttpHandler() (handler http.Handler) {
	modMux := mux.NewRouter()
	modMux.PathPrefix("/dashboard/").
		Handler(http.StripPrefix("/dashboard/", dashboard.HttpHandler()))
	return modMux
}