Chi http driver for Goravel.
goravel/chi | goravel/framework |
---|---|
v1.0.x | v1.15.x |
- Add package
go get -u github.com/goravel/chi
- Register service provider
// config/app.go
import "github.com/goravel/chi"
"providers": []foundation.ServiceProvider{
...
&chi.ServiceProvider{},
}
- Add chi config to
config/http.go
file
// config/http.go
import (
"html/template"
chifacades "github.com/goravel/chi/facades"
"github.com/goravel/chi"
)
"default": "chi",
"drivers": map[string]any{
"chi": map[string]any{
// Optional, default is 4096 KB
"body_limit": 4096,
"header_limit": 4096,
"route": func() (route.Route, error) {
return chifacades.Route(), nil
},
// Optional, default is http/template
"template": func() (*template.Template, error) {
return new(template.Template), nil
},
},
},
Run command below to run test:
go test ./...