web

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package web embeds the relay-ui single-page app and serves it from the control plane.

The built UI dist is fetched at image-build time (a pinned relay-ui release tarball untarred into ./dist; see the Dockerfile and `make ui-fetch`) and baked into the binary via go:embed. The embed lives here in the composition root rather than under app/ so the http API packages stay asset-free.

Serving is same-origin by design: the UI resolves the control API to window.location.origin when VITE_CONTROL_API_URL is unset, so mounting it on the control listener needs no runtime config, no CORS, and no cookie relaxation. Out of scope: a standalone UI port (deliberately folded onto the control plane — disable via RELAY_UI_DISABLE instead).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler() http.Handler

Handler serves the embedded SPA: real files (assets, favicon, ...) are served directly; everything else falls back to index.html so client-side routes resolve. Intended to be registered as the control router's NotFound handler, after all API operations — matched API paths never reach it.

func Present

func Present() bool

Present reports whether a real UI dist was baked in. A source/dev build (or any build where ui-fetch did not run) embeds only an empty dist, so the handler must not be mounted — index.html absence is the signal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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