示例#1
0
文件: main.go 项目: andviro/noodle
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
文件: helpers.go 项目: andviro/noodle
// Default creates new Wok with the default Noodle middleware chain
func Default(mws ...noodle.Middleware) *Wok {
	return New(mw.Default(mws...)...)
}