From 0a7169a537a74985051b7c82ff09bcfb3d26ac94 Mon Sep 17 00:00:00 2001 From: Milad Rahimi Date: Fri, 4 Mar 2022 19:30:22 +0330 Subject: [PATCH 1/3] Update README.md --- README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3770c90..402c512 100644 --- a/README.md +++ b/README.md @@ -154,12 +154,9 @@ func main() { r.GET("/links", func(c router.Context) error { return c.JSON(http.StatusOK, response.M{ - // "/" - "home": c.URL("home", nil), - // "/posts/1" - "post-1": c.URL("post", map[string]string{"id": "1"}), - // "/posts/2" - "post-2": c.URL("post", map[string]string{"id": "2"}), + "home": c.URL("home", nil), // "/" + "post-1": c.URL("post", map[string]string{"id": "1"}), // "/posts/1" + "post-2": c.URL("post", map[string]string{"id": "2"}), // "/posts/2" }) }) From 2fed663fa6c73c3456d1eee3bd37a3b7e1f8dcef Mon Sep 17 00:00:00 2001 From: Milad Rahimi Date: Fri, 4 Mar 2022 19:33:37 +0330 Subject: [PATCH 2/3] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 402c512..b3890d1 100644 --- a/README.md +++ b/README.md @@ -253,12 +253,11 @@ func main() { r := router.New() r.WithPrefix("/blog", func() { - r.GET("/posts", PostsHandler) - r.GET("/posts/:id", PostHandler) - - r.WithPrefix("/pages", func() { - r.GET("/about", AboutHandler) - r.GET("/contact", ContactHandler) + r.GET("/posts", PostsHandler) // "/blog/posts" + r.GET("/posts/:id", PostHandler) // "/blog/posts/:id" + r.WithPrefix("/pages", func() { + r.GET("/about", AboutHandler) // "/blog/pages/about" + r.GET("/contact", ContactHandler) // "/blog/pages/contact" }) }) @@ -430,6 +429,7 @@ import ( func main() { r := router.New() + // Custom (HTML) Not Found Handler r.SetNotFoundHandler(func(c router.Context) error { return c.HTML(404, "

404 Not Found

") }) From 90e05d4ac4016311260f026618ac001b5e3094cf Mon Sep 17 00:00:00 2001 From: Milad Rahimi Date: Fri, 4 Mar 2022 19:34:19 +0330 Subject: [PATCH 3/3] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b3890d1..2aa22e9 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ It's built on top of the Go HTTP package and uses radix tree to provide the foll * Middleware * HTTP Responses (such as JSON, XML, Text, Empty, and Redirect) * No footprint! +* Zero-dependency! ## Documentation ### Required Go Version