spa

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package spa serves the embedded admin single-page application: the production Vue build at rest plus the development-mode reverse proxy to the Vite server. Unknown paths fall back to index.html so the SPA router owns client-side navigation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FS

func FS() fs.FS

FS exposes the embedded production build for tests and tooling.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler serves the admin SPA: a dev-mode reverse proxy when enabled, otherwise files from the embedded production build with an index.html fallback for unknown paths.

func NewHandler

func NewHandler(devMode bool, adminURL string) *Handler

NewHandler creates a Handler. adminURL is the Vite dev server target used only when devMode is set.

func (*Handler) ServeAdmin

func (h *Handler) ServeAdmin(w http.ResponseWriter, r *http.Request)

ServeAdmin serves the admin SPA: the dev-server proxy in dev mode, embedded files in production, index.html for anything else.

Jump to

Keyboard shortcuts

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