ui

package
v0.5.56 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package ui serves the admin SPA as static files from a pre-built Vite dist directory. It provides a catch-all SPA fallback that serves index.html for any path not matched by other routes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRoutes

func RegisterRoutes(router *mux.Router, getDistPath func() string, logger log.Logger)

RegisterRoutes registers static file serving and SPA fallback routes. The getDistPath function is called at request time so routes can be mounted before PostSetup sets the dist path (same pattern as helper). Must be called AFTER all API routes are registered, since the catch-all PathPrefix("/") would otherwise shadow more specific routes.

Types

type Config

type Config struct {
	Enable   bool   `mapstructure:"enable"`
	DistPath string `mapstructure:"dist_path"`
}

Config holds the UI server configuration, read from app.toml ui.

Jump to

Keyboard shortcuts

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