gobin/utils/assets.go

18 lines
330 B
Go
Raw Normal View History

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,
}))
}