fiber/middleware/skip
leonklingele 167a8b5e94
🚀 Feature: Add and apply more stricter golangci-lint linting rules (#2286)
* golangci-lint: add and apply more stricter linting rules

* github: drop security workflow now that we use gosec linter inside golangci-lint

* github: use official golangci-lint CI linter

* Add editorconfig and gitattributes file
2023-01-27 09:01:37 +01:00
..
README.md correct documentation for the skip middleware 2021-08-24 08:38:15 +02:00
skip.go 🚀 Feature: Add and apply more stricter golangci-lint linting rules (#2286) 2023-01-27 09:01:37 +01:00
skip_test.go 🚀 Feature: Add and apply more stricter golangci-lint linting rules (#2286) 2023-01-27 09:01:37 +01:00

README.md

Skip

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

Table of Contents

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 }))