Skip to content

Latest commit

 

History

History
76 lines (59 loc) · 1.99 KB

README.md

File metadata and controls

76 lines (59 loc) · 1.99 KB

Fiber

Doc Go Release Test Report Card Codecov License

Fiber http driver for Goravel.

Version

goravel/fiber goravel/framework
v1.2.x v1.14.x
v1.1.x v1.13.x

Install

  1. Add package
go get -u github.com/goravel/fiber
  1. Register service provider
// config/app.go
import "github.com/goravel/fiber"

"providers": []foundation.ServiceProvider{
    ...
    &fiber.ServiceProvider{},
}
  1. 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
        },
    },
},

Testing

Run command below to run test:

go test ./...