Monitor
Monitor middleware for Fiber that reports server metrics, inspired by express-status-monitor​
:warning: Warning: Monitor is still in beta, API might change in the future!

Table of Contents

Signatures

1
func New() fiber.Handler
Copied!

Examples

Import the middleware package and assign it to a route.
1
package main
2
​
3
import (
4
"log"
5
​
6
"github.com/gofiber/fiber/v2"
7
"github.com/gofiber/fiber/v2/middleware/monitor"
8
)
9
​
10
func main() {
11
app := fiber.New()
12
​
13
app.Get("/dashboard", monitor.New())
14
​
15
log.Fatal(app.Listen(":3000"))
16
}
Copied!

Config

1
// Config defines the config for middleware.
2
type Config struct {
3
// Next defines a function to skip this middleware when returned true.
4
//
5
// Optional. Default: nil
6
Next func(c *fiber.Ctx) bool
7
}
Copied!

Default Config

1
var ConfigDefault = Config{
2
Next: nil,
3
}
Copied!
Last modified 2mo ago