code: func NewHandler(proxy bool, peers []string) *Handler {
  	r := httprouter.New()
  
  	h := &Handler{Handler: r}
  	h.Shutdown.Store(false)
  
  	h.Peers = peers
  	h.Proxy.Store(proxy)
  
  	if os.Getenv("DEBUG") != "" {
  		h.Handler = hh.ContextInjector("discoverd", hh.NewRequestLoggerCustom(h.Handler, loggerFn))
  	}
  
  	r.HandlerFunc("GET", status.Path, status.HealthyHandler.ServeHTTP)
  
  	r.PUT("/services/:service", h.servePutService)
  	r.DELETE("/services/:service", h.serveDeleteService)
  	r.GET("/services/:service", h.serveGetService)
  
  	r.PUT("/services/:service/meta", h.servePutServiceMeta)
  	r.GET("/services/:service/meta", h.serveGetServiceMeta)
  
  	r.PUT("/services/:service/instances/:instance_id", h.servePutInstance)
  	r.DELETE("/services/:service/instances/:instance_id", h.serveDeleteInstance)
  	r.GET("/services/:service/instances", h.serveGetInstances)
  
  	r.PUT("/services/:service/leader", h.servePutLeader)
  	r.GET("/services/:service/leader", h.serveGetLeader)
  
  	r.GET("/raft/leader", h.serveGetRaftLeader)
  	r.GET("/raft/peers", h.serveGetRaftPeers)
  	r.PUT("/raft/peers/:peer", h.servePutRaftPeer)
  	r.DELETE("/raft/peers/:peer", h.serveDeleteRaftPeer)
  	r.POST("/raft/promote", h.servePromote)
  	r.POST("/raft/demote", h.serveDemote)
  
  	r.GET("/ping", h.servePing)
  
  	r.POST("/shutdown", h.serveShutdown)
  	return h
  }
docs: // NewHandler returns a new instance of Handler.