responsetime

package module
v0.0.0-...-fe024b4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2021 License: MIT Imports: 3 Imported by: 0

README

fiber-responsetime

X-Response-Time middleware for fiber/v2

package main

import (
	"time"

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

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!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() fiber.Handler

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL