mirror of
https://github.com/gofiber/fiber.git
synced 2025-05-16 04:33:01 +00:00
623 B
623 B
id, title
id | title |
---|---|
skip | Skip |
Skip middleware for Fiber that skips a wrapped handler if a predicate is true.
Signatures
func New(handler fiber.Handler, exclude func(c *fiber.Ctx) bool) fiber.Handler
Examples
Import the middleware package that is part of the Fiber web framework
import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/skip"
)
After you initiate your Fiber app, you can use the following possibilities:
app.Use(skip.New(handler, func(ctx *fiber.Ctx) bool { return ctx.Method() == fiber.MethodOptions }))