2016-02-14 09:42:55 +00:00
|
|
|
// Package negroni is an idiomatic approach to web middleware in Go. It is tiny, non-intrusive, and encourages use of net/http Handlers.
|
|
|
|
//
|
|
|
|
// If you like the idea of Martini, but you think it contains too much magic, then Negroni is a great fit.
|
|
|
|
//
|
2016-06-07 16:09:52 +00:00
|
|
|
// For a full guide visit http://github.com/codegangsta/negroni
|
2016-02-14 09:42:55 +00:00
|
|
|
//
|
|
|
|
// package main
|
|
|
|
//
|
|
|
|
// import (
|
2016-06-07 16:09:52 +00:00
|
|
|
// "github.com/codegangsta/negroni"
|
2016-02-14 09:42:55 +00:00
|
|
|
// "net/http"
|
|
|
|
// "fmt"
|
|
|
|
// )
|
|
|
|
//
|
|
|
|
// 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.UseHandler(mux)
|
|
|
|
// n.Run(":3000")
|
|
|
|
// }
|
|
|
|
package negroni
|