1
0
mirror of https://github.com/gofiber/fiber.git synced 2025-02-23 17:23:51 +00:00
fiber/middleware/recover.md
2020-07-02 12:16:12 +02:00

599 B

Recover

Recover middleware recovers from panics anywhere in the stack chain and handles the control to the centralized ErrorHandler.

Example

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

import (
  "github.com/gofiber/fiber"
  "github.com/gofiber/fiber/middleware"
)

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

func main() {
  app := fiber.New()
    
  // Default recover
  app.Use(middleware.Recover())

  // ...
}

Signatures

func Recover() fiber.Handler {}