Skip to content

goravel/fiber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

269cc4c · Jan 1, 2025
Sep 21, 2024
Aug 28, 2023
Aug 31, 2023
Dec 20, 2024
Jun 30, 2023
Dec 31, 2024
Dec 17, 2024
Dec 30, 2024
Dec 14, 2024
Dec 29, 2024
Nov 11, 2024
Dec 15, 2024
Jan 1, 2025
Jan 1, 2025
Nov 15, 2023
Dec 30, 2024
Jul 3, 2024
Nov 11, 2024
Nov 11, 2024
Dec 30, 2024
Dec 30, 2024
Jul 3, 2024
Dec 29, 2024
Jan 1, 2025
Jan 1, 2025
Aug 29, 2023
Jun 30, 2023
Jun 30, 2023
Dec 17, 2024
Jun 30, 2023
Sep 7, 2023
Feb 15, 2024

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{
        // 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 ./...