web

package
v0.0.6 Latest Latest
Warning

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

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

Documentation

Overview

Package web serves embedded single-page applications with optional Go-template index data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SPA

type SPA struct {
	// Assets is rooted at the web distribution directory.
	Assets fs.FS
	// Index defaults to index.html.
	Index string
	// BasePath is the URL mount prefix, for example /motus/.
	BasePath string
	// TemplateData provides optional extra values for index.html.
	TemplateData map[string]any
}

SPA describes a frontend build and its externally mounted base path.

func (SPA) Handler

func (s SPA) Handler() http.Handler

Handler serves index for browser navigations and rejects missing static assets.

Jump to

Keyboard shortcuts

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