mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 17:44:29 +00:00
23 lines
388 B
Go
23 lines
388 B
Go
|
package diagnostics
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"io"
|
||
|
"net/http"
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
func SetupCmdLineAccess() {
|
||
|
http.HandleFunc("/debug/metrics/cmdline", func(w http.ResponseWriter, r *http.Request) {
|
||
|
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||
|
writeCmdLine(w)
|
||
|
})
|
||
|
}
|
||
|
|
||
|
func writeCmdLine(w io.Writer) {
|
||
|
fmt.Fprintf(w, "SUCCESS\n")
|
||
|
for _, arg := range os.Args {
|
||
|
fmt.Fprintf(w, "%s\n", arg)
|
||
|
}
|
||
|
}
|