Skip to content

husanu/fiber-responsetime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fiber-responsetime

X-Response-Time middleware for fiber/v2

go get github.com/husanu/fiber-responsetime/v2
package main

import (
	"time"

	"github.com/gofiber/fiber/v2"
	responsetime "github.com/husanu/fiber-responsetime/v2"
)

func main() {
	app := fiber.New()

	app.Use(responsetime.New())

	app.Get("/", func(c *fiber.Ctx) error {
		time.Sleep(666 * time.Millisecond)
		return c.SendString("Hello, World!")
	})

	app.Listen(":3000")
}
curl -i http://localhost:3000/
HTTP/1.1 200 OK
Date: Thu, 16 Dec 2021 10:04:13 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 13
X-Response-Time: 670ms

Hello, World!

About

X-Response-Time middleware for fiber/v2

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages