Created
November 13, 2018 07:23
-
-
Save aisk/563625caf1c46f66e88cd598fbda5b74 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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