mirror of
https://github.com/LBRYFoundation/lbcd.git
synced 2025-08-23 17:47:24 +00:00
Add default redirect for profiling when enabled.
This commit adds a simple 303 redirect for the root of profile server so launching it without a path automatically goes to the debug profiling page.
This commit is contained in:
parent
7846b2f4e2
commit
cc6cfdad9e
1 changed files with 3 additions and 0 deletions
3
btcd.go
3
btcd.go
|
@ -48,6 +48,9 @@ func btcdMain() error {
|
||||||
go func() {
|
go func() {
|
||||||
listenAddr := net.JoinHostPort("", cfg.Profile)
|
listenAddr := net.JoinHostPort("", cfg.Profile)
|
||||||
log.Infof("Profile server listening on %s", listenAddr)
|
log.Infof("Profile server listening on %s", listenAddr)
|
||||||
|
profileRedirect := http.RedirectHandler("/debug/pprof",
|
||||||
|
http.StatusSeeOther)
|
||||||
|
http.Handle("/", profileRedirect)
|
||||||
log.Errorf("%v", http.ListenAndServe(listenAddr, nil))
|
log.Errorf("%v", http.ListenAndServe(listenAddr, nil))
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue