Route

Contains the matched Route struct.

  1. c.Route() *Route
  1. // http://localhost:8080/hello
  2.  
  3. app.Get("/hello", func(c *fiber.Ctx) {
  4. r := c.Route()
  5. fmt.Println(r.Method, r.Path, r.Params, r.Regexp, r.Handler)
  6. })
  7.  
  8. app.Post("/:api?", func(c *fiber.Ctx) {
  9. c.Route()
  10. // => {GET /hello [] nil 0x7b49e0}
  11. })