mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2024-11-26 05:55:27 +00:00
22 lines
400 B
Go
22 lines
400 B
Go
|
package server
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
_ "net/http/pprof"
|
||
|
|
||
|
"github.com/rs/zerolog/log"
|
||
|
)
|
||
|
|
||
|
func StartProfilingServer(listeningAddress string) {
|
||
|
server := &http.Server{
|
||
|
Addr: listeningAddress,
|
||
|
Handler: http.DefaultServeMux,
|
||
|
}
|
||
|
|
||
|
log.Info().Msgf("Starting debug server on %s", listeningAddress)
|
||
|
|
||
|
go func() {
|
||
|
log.Fatal().Err(server.ListenAndServe()).Msg("Failed to start debug server")
|
||
|
}()
|
||
|
}
|