Пример #1
0
func main() {
	r := mux.NewRouter()
	n := mw.Default(gorilla.Vars)
	r.Handle("/", n.Then(index))
	r.Handle("/products/{id}", n.Then(products))
	log.Fatal(http.ListenAndServe(":8080", r))
}
Пример #2
0
func TestDefault(t *testing.T) {
	is := is.New(t)
	def := mw.Default()
	is.NotNil(def)
}
Пример #3
0
// Default creates new Wok with the default Noodle middleware chain
func Default(mws ...noodle.Middleware) *Wok {
	return New(mw.Default(mws...)...)
}