doc.go 702 B

12345678910111213141516171819202122232425
  1. // Package negroni is an idiomatic approach to web middleware in Go. It is tiny, non-intrusive, and encourages use of net/http Handlers.
  2. //
  3. // If you like the idea of Martini, but you think it contains too much magic, then Negroni is a great fit.
  4. //
  5. // For a full guide visit http://github.com/urfave/negroni
  6. //
  7. // package main
  8. //
  9. // import (
  10. // "github.com/urfave/negroni"
  11. // "net/http"
  12. // "fmt"
  13. // )
  14. //
  15. // func main() {
  16. // mux := http.NewServeMux()
  17. // mux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
  18. // fmt.Fprintf(w, "Welcome to the home page!")
  19. // })
  20. //
  21. // n := negroni.Classic()
  22. // n.UseHandler(mux)
  23. // n.Run(":3000")
  24. // }
  25. package negroni