Fiber http driver for Goravel.
goravel/fiber | goravel/framework |
---|---|
v1.2.x | v1.14.x |
v1.1.x | v1.13.x |
- Add package
go get -u github.com/goravel/fiber
- Register service provider
// config/app.go
import "github.com/goravel/fiber"
"providers": []foundation.ServiceProvider{
...
&fiber.ServiceProvider{},
}
- Add fiber config to
config/http.go
file
// config/http.go
import (
fiberfacades "github.com/goravel/fiber/facades"
"github.com/gofiber/template/html/v2"
"github.com/gofiber/fiber/v2"
)
"default": "fiber",
"drivers": map[string]any{
"fiber": map[string]any{
// prefork mode, see https://docs.gofiber.io/api/fiber/#config
"prefork": false,
// Optional, default is 4096 KB
"body_limit": 4096,
"header_limit": 4096,
"route": func() (route.Route, error) {
return fiberfacades.Route("fiber"), nil
},
// Optional, default is "html/template"
"template": func() (fiber.Views, error) {
return html.New("./resources/views", ".tmpl"), nil
},
},
},
Run command below to run test:
go test ./...