Documentation
¶
Overview ¶
Package web embeds the built bench dashboard so a self-hosted hub serves the same pages the hosted instance does, with no Node runtime and no configuration.
dist/ is produced by `pnpm build` in this directory and is git-ignored except for dist/.gitkeep, which exists because go:embed refuses a directory that is not there. The Astro build copies public/.gitkeep back into dist/, so building never deletes the tracked placeholder. A wb built from a clean clone therefore compiles, and Handler serves a one-line page explaining how to build the real dashboard.
Index ¶
Constants ¶
const MountPath = "/workbench/"
MountPath is where the dashboard is served. The Astro build hard-codes it as the site base, so every asset URL in the emitted HTML already starts here and the pages need no rewriting.
Variables ¶
var Dist embed.FS
Dist holds every file the Astro build emitted, or only .gitkeep in a clone where `pnpm build` has never run.
Functions ¶
func Handler ¶
Handler serves the embedded dashboard under MountPath. It implements the Astro build's trailingSlash: 'always' + build.format: 'directory' contract: a request for a directory is answered with that directory's index.html, and a request that omits the trailing slash is redirected to the one that has it — the same shape a static host gives the hosted instance.
Mount it on a mux at MountPath; the prefix is stripped here so the caller does not have to.
Types ¶
This section is empty.