code: func (s *HTTPServer) Index(resp http.ResponseWriter, req *http.Request) {
  	// Check if this is a non-index path
  	if req.URL.Path != "/" {
  		resp.WriteHeader(http.StatusNotFound)
  		return
  	}
  
  	// Give them something helpful if there's no UI so they at least know
  	// what this server is.
  	if !s.IsUIEnabled() {
  		fmt.Fprint(resp, "Consul Agent")
  		return
  	}
  
  	// Redirect to the UI endpoint
  	http.Redirect(resp, req, "/ui/", http.StatusMovedPermanently) // 301
  }
docs: // Renders a simple index page