bundle

package
v1.3.25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigDefault = Config{
	Next:               nil,
	Bundle:             htmx.Bundle,
	Root:               htmx.BundleFolder,
	PathPrefix:         "",
	MaxAge:             0,
	ContentTypeCharset: "",
}

ConfigDefault is the default config

Functions

func New

func New(config ...Config) fiber.Handler

New ... nolint:gocyclo

Types

type Config

type Config struct {
	// Next defines a function to skip this middleware when returned true.
	Next func(c *fiber.Ctx) bool
	// Bundle is the http.FileSystem to serve.
	Bundle fs.FS `json:"-"`
	// Root is the root directory of the Bundle.
	Root string `json:"root"`
	// PathPrefix is the optional prefix used to serve the filesystem content.
	PathPrefix string `json:"path_prefix"`
	// MaxAge defines the max-age of the Cache-Control header in seconds.
	MaxAge int `json:"max_age"`
	// ContentTypeCharset defines the charset of the Content-Type header.
	ContentTypeCharset string `json:"content_type_charset"`
}

Config defines the config for middleware.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL