ui

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package ui embeds the pre-built React frontend and exposes it as an fs.FS so the server can serve it from the same origin as the API (eliminating all CORS configuration for self-hosted deployments).

Development workflow (no embedding needed)

Run the Vite dev server separately:

cd frontend && npm run dev

Vite proxies /api → localhost:8080 automatically (see vite.config.ts). The backend serves only the API; the browser fetches everything from Vite.

Production / Docker workflow

The multi-stage Dockerfile builds the frontend first, copies the output into this directory, then compiles the Go binary. The embed directive captures whatever is in dist/ at compile time.

If dist/ contains only .gitkeep (i.e. no real frontend build), FS() returns nil and the router skips static serving — the API still works.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FS

func FS() fs.FS

FS returns the embedded frontend as an fs.FS rooted at the dist/ directory, or nil if the frontend has not been built (dist/ contains only .gitkeep). Callers must check for nil before registering the static file handler.

Types

This section is empty.

Jump to

Keyboard shortcuts

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