gobin/utils/assets.go

17 lines
330 B
Go

package utils
import (
"embed"
"net/http"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"
)
func ActivateAssets(app *fiber.App, publicfs *embed.FS) {
app.Use("/assets", filesystem.New(filesystem.Config{
Root: http.FS(publicfs),
PathPrefix: "assets",
Browse: false,
}))
}