github.com/pyroscope-io/pyroscope@v0.37.3-0.20230725203016-5f6947968bd0/pkg/server/config.go (about)

     1  package server
     2  
     3  import (
     4  	"encoding/json"
     5  	"net/http"
     6  )
     7  
     8  func (ctrl *Controller) configHandler(w http.ResponseWriter, r *http.Request) {
     9  	configBytes, err := json.MarshalIndent(ctrl.config, "", "  ")
    10  	if err != nil {
    11  		ctrl.httpUtils.WriteJSONEncodeError(r, w, err)
    12  		return
    13  	}
    14  	w.Header().Set("Content-Type", "application/json")
    15  	_, _ = w.Write(configBytes)
    16  }