Skip to content

Instantly share code, notes, and snippets.

@aisk
Created November 13, 2018 07:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aisk/563625caf1c46f66e88cd598fbda5b74 to your computer and use it in GitHub Desktop.
Save aisk/563625caf1c46f66e88cd598fbda5b74 to your computer and use it in GitHub Desktop.
package main
import (
"net/http"
"net/http/pprof"
"github.com/aisk/vox"
)
func main() {
app := vox.New()
app.Get("/", func(req *vox.Request, res *vox.Response) {
res.Body = "Hello, World!"
})
mux := http.NewServeMux()
mux.HandleFunc("/debug/pprof/", pprof.Index)
mux.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline)
mux.HandleFunc("/debug/pprof/profile", pprof.Profile)
mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
mux.HandleFunc("/debug/pprof/trace", pprof.Trace)
mux.Handle("/", app)
http.ListenAndServe(":3000", mux)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment