Next

When Next is called, it executes the next method in the stack that matches the current route. You can pass an error struct within the method that will end the chaining and call the error handler.

  1. func (c *Ctx) Next() error
  1. app.Get("/", func(c *fiber.Ctx) error {
  2. fmt.Println("1st route!")
  3. return c.Next()
  4. })
  5. app.Get("*", func(c *fiber.Ctx) error {
  6. fmt.Println("2nd route!")
  7. return c.Next()
  8. })
  9. app.Get("/", func(c *fiber.Ctx) error {
  10. fmt.Println("3rd route!")
  11. return c.SendString("Hello, World!")
  12. })