Skip to content

goravel/fiber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fiber

Doc Go Release Test Report Card Codecov License

Fiber http driver for Goravel.

Version

goravel/fiber goravel/framework
v1.3.x v1.15.x
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{
        // immutable mode, see https://docs.gofiber.io/#zero-allocation
        // WARNING: This option is dangerous. Only change it if you fully understand the potential consequences.
        "immutable": true,
        // 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 ./...