spa

package
v2.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package spa embeds the web interface's build and serves it at "/", falling back to index.html for any path that is not a real file, so client-side routes resolve on a hard refresh. Never applied to "/api": the caller mounts that separately, before this handler.

The build is a cartograph-ui release, not source: `just ui` (and the flake) unpack the release UI_VERSION names into dist, checked against UI_SHA256, and `just ui <path>` puts a local build there instead. Dir serves a build from a directory at run time instead (CARTOGRAPH_UI_DIR), so a container image tries an interface build without being rebuilt.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dir added in v2.11.0

func Dir(dir string) (http.Handler, error)

Dir serves the build in dir, as Handler serves the embedded one. A directory without an index.html is refused, so a wrong path fails at start rather than as a blank page.

func Handler

func Handler() http.Handler

Handler serves the embedded build with a single-page-app fallback.

Types

This section is empty.

Jump to

Keyboard shortcuts

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