diff --git a/examples/main.go b/examples/main.go index ef32c10..ba10e6d 100644 --- a/examples/main.go +++ b/examples/main.go @@ -14,6 +14,9 @@ func main() { app.Post("/login", func(c *fiber.Ctx) error { return c.SendString("Login") }) + app.Put("/login/:uid", func(c *fiber.Ctx) error { + return c.SendString("Login") + }) app.Get("/user/:id", func(c *fiber.Ctx) error { return c.SendString("User") }) diff --git a/main.go b/main.go index 9620bfd..47f6150 100644 --- a/main.go +++ b/main.go @@ -75,8 +75,12 @@ func printByPathStacks(stacks []*fiber.Route) { c = color.HiCyanString case "GET": c = color.HiYellowString - case "POST", "PUT", "PATCH": + case "POST": c = color.HiGreenString + case "PUT": + c = color.HiBlueString + case "PATCH": + c = color.HiCyanString case "DELETE": c = color.HiRedString default: @@ -91,7 +95,7 @@ func printByPathStacks(stacks []*fiber.Route) { func getRouteParams(route *fiber.Route) string { var params string if len(route.Params) > 0 { - params = fmt.Sprintf("Params: %v", route.Params) + params = fmt.Sprintf("params:%v", route.Params) } return params }