frontend

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(fsys fs.FS, m Manifest) http.Handler

Handler returns an http.Handler that serves an embedded Vite build as a Module Federation remote.

Routes registered under /ui/:

/ui/health           — 200 if remoteEntry.js exists, 503 if not
/ui/assets/*         — immutable content-hashed chunks (1yr cache)
/ui/remoteEntry.js   — federation entry point (no-cache)
/ui/*                — everything else (no-cache)

The fsys must be rooted at the Vite build output directory (e.g., the result of fs.Sub(embedFS, "web/dist")).

Types

type Manifest

type Manifest struct {
	Name    string   `json:"name"`
	Label   string   `json:"label"`
	Route   string   `json:"route"`
	WSPaths []string `json:"ws_paths,omitempty"`
}

Manifest describes the frontend module for service-discovery purposes.

Jump to

Keyboard shortcuts

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