web

package
v3.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetStaticFS

func SetStaticFS(fsys fs.FS)

SetStaticFS replaces the admin static filesystem.

Intended use: a thin-wrap host binary (e.g. services/ic-crm) embeds its own Nuxt-layer dist and calls SetStaticFS in main() before invoking the serve command. The replacement FS must contain a `dist/` directory whose contents mirror the embedded admin layout (serve.go passes `Root: "dist"` to the static middleware, which calls `fs.Sub(fsys, "dist")` — so `dist/index.html` must be readable under the FS root).

Must be called before the serve command constructs the HTTP stack. Once the static middleware is wired, it captures the FS at config time — later SetStaticFS calls cannot reach already-running handlers.

Panics if fsys is nil (bare-nil interface value, or a typed-nil pointer/map/slice/chan/func stored in the fs.FS interface). A nil FS would crash the static middleware with a less actionable error during request serving; failing fast at the setter call site (in main()) gives a clear stack trace at the point of the bug.

See docs/decisions/admin-index-override.md for the design rationale.

func StaticFS

func StaticFS() fs.FS

StaticFS returns the active admin static filesystem. Consumers (notably the serve command's static middleware wiring) must call this rather than reading a package-level value, so a host binary's SetStaticFS replacement takes effect.

Types

This section is empty.

Jump to

Keyboard shortcuts

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