Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 960 Bytes

README.md

File metadata and controls

34 lines (25 loc) · 960 Bytes

negroni-pprof

GoDoc Build Status

pprof middleware for Negroni

pprof

pprof middleware for Negroni.

A simple middleware for handling pprof. This handles "/debug/pprof" paths

Note: this implementation is sub-optimal, but works.

Usage

import (
    "github.com/codegangsta/negroni"
    "github.com/mistifyio/negroni-pprof"
)

func main() {
    mux := http.NewServeMux()
    mux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
      fmt.Fprintf(w, "Welcome to the home page!")
    }
    n := negroni.Classic()
    n.Use(pprof.Pprof())
    n.UseHandler(mux)
    n.Run(":3000")
}