Skip to main content
Version: Next


Skip middleware for Fiber that skips a wrapped handler if a predicate is true.


func New(handler fiber.Handler, exclude func(c fiber.Ctx) bool) fiber.Handler


Import the middleware package that is part of the Fiber web framework

import (

After you initiate your Fiber app, you can use the following possibilities:

func main() {
app := fiber.New()

app.Use(skip.New(BasicHandler, func(ctx fiber.Ctx) bool {
return ctx.Method() == fiber.MethodGet

app.Get("/", func(ctx fiber.Ctx) error {
return ctx.SendString("It was a GET request!")


func BasicHandler(ctx fiber.Ctx) error {
return ctx.SendString("It was not a GET request!")

app.Use will handle requests from any route, and any method. In the example above, it will only skip if the method is GET.