diff --git a/example/main.go b/example/main.go index 3843a64..ce97501 100644 --- a/example/main.go +++ b/example/main.go @@ -25,7 +25,7 @@ func main() { // let's add a route r.Get("/hello", func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("hello1")) + w.Write([]byte("i am route /hello")) }) // r.Post(pattern string, h http.HandlerFunc) // r.Put(pattern string, h http.HandlerFunc) @@ -34,8 +34,8 @@ func main() { // you can inline middleware(s) to a route r. With(mwInline). - Get("/test", func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("middle ware 3 test")) + Get("/hello-2", func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("i am route /hello-2 with my own middleware")) }) // you define a resource @@ -50,18 +50,18 @@ func main() { // PATCH /photos/:id // DELETE /photos/:id resource.Index(func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("user index")) + w.Write([]byte("all photos")) }) resource.New(func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("create new user")) + w.Write([]byte("upload a new pohoto")) }) }) r.Group(func(grp *mux.Router) { grp.Use(mwGroup) grp.Get("/group", func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("i am group 1")) + w.Write([]byte("i am route /group")) }) })