Skip to content

goravel/fiber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

253 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fiber

Doc Go Release Test Report Card Codecov License

Fiber http driver for Goravel.

Version

goravel/fiber goravel/framework
v1.17.x v1.17.x
v1.4.x v1.16.x
v1.3.x v1.15.x
v1.2.x v1.14.x
v1.1.x v1.13.x

Install

Run the command below in your project to install the package automatically:

./artisan package:install github.com/goravel/fiber

Or check the setup file to install the package manually.

Configuration

You can define the template configuration. If omitted, DefaultTemplate() is used automatically as a fallback, which loads views from resources/views and any registered package views.

You can provide a custom template configuration in two forms:

  • func() (fiber.Views, error) — a callback that returns a custom template engine (e.g. to configure custom delimiters or a FuncMap).
  • fiber.Views — a pre-built template engine instance.

Custom example:

import (
    "html/template"

    "github.com/gofiber/fiber/v3"
    goravelfiber "github.com/goravel/fiber"
)

"template": func() (fiber.Views, error) {
    return goravelfiber.NewTemplate(goravelfiber.RenderOptions{
        Delims: &goravelfiber.Delims{Left: "{[", Right: "]}"},
        FuncMap: template.FuncMap{
            "upper": strings.ToUpper,
        },
    })
},

Testing

Run command below to run test:

go test ./...

About

The Fiber driver for Route module of Goravel

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages