mirror of https://github.com/gofiber/fiber.git
* ci: explicitly disable tagalign Tagalign requires awkward manual formatting and doesn't provide much value for readability. * ci: enable mirror linter mirror warns against certain cases of useless conversion between string and []byte. * ci: enable perfsprint linter This linter encourages replacing several functions from the fmt package with faster alternatives. While fixing issues, I also added a few exported error types rather than returning a naked errors.New(). |
||
---|---|---|
.. | ||
README.md | ||
config.go | ||
helmet.go | ||
helmet_test.go |
README.md
Helmet
Install
go get -u github.com/gofiber/fiber/v3
go get -u github.com/gofiber/helmet/v2
Example
package main
import (
"github.com/gofiber/fiber/v3"
"github.com/gofiber/helmet/v2"
)
func main() {
app := fiber.New()
app.Use(helmet.New())
app.Get("/", func(c fiber.Ctx) error {
return c.SendString("Welcome!")
})
app.Listen(":3000")
}
Test
curl -I http://localhost:3000