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

Table of Contents

Signatures

1
func New(handler fiber.Handler, exclude func(c *fiber.Ctx) bool) fiber.Handler
Copied!

Examples

Import the middleware package that is part of the Fiber web framework
1
import (
2
"github.com/gofiber/fiber/v2"
3
"github.com/gofiber/fiber/v2/middleware/skip"
4
)
Copied!
After you initiate your Fiber app, you can use the following possibilities:
1
app.Use(skip.New(handler, func(ctx *fiber.Ctx) bool { return ctx.Method() == fiber.MethodOptions }))
Copied!
Last modified 3mo ago