Documentation
¶
Overview ¶
Package frontend provides a static file server for the frontend assets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrFrontendAddrRequired = errors.New("frontend address is required when frontend is enabled")
)
ErrFrontendAddrRequired is returned when frontend is enabled but no address is configured
Functions ¶
func NewHandler ¶ added in v0.0.30
func NewHandler(cfg *InjectedConfig) (http.Handler, error)
NewHandler creates a new frontend HTTP handler with SPA fallback support. If cfg is non-nil, its fields are injected as window.__CONFIG__ into index.html.
Types ¶
type Config ¶
type Config struct {
Enabled bool `yaml:"enabled" default:"false"`
Addr string `yaml:"addr" default:":8080" validate:"hostname_port"`
}
Config represents frontend service configuration
type InjectedConfig ¶ added in v0.1.0
type InjectedConfig struct {
ManagementEnabled bool `json:"managementEnabled,omitempty"`
AuthMethods []string `json:"authMethods,omitempty"`
}
InjectedConfig holds runtime configuration injected into the frontend HTML.
Click to show internal directories.
Click to hide internal directories.