nandi/oripublic Fork 0
b6cd929ab1425a4ef6073ea9c189917cca02cf3c
Commits
Clone
git clone https://git.rickub.com/nandi/ori.git
git clone ssh://git@rickub.com/nandi/ori.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

forked from bots-garden/ori

embed.go · 31 lines · 872 BGo Blame HistoryRaw
✨ Introduce new feature(s): ACP web client — Go backend (agent, bridge, httpserver, mockagent) + React SPA (Zed-like agent panel), tests, quality gate PASS 2434cc7 k33g yesterday1// Package ui embeds the production build of the single-page application so
2// the ori server ships as a single binary.
3//
4// The Vite build writes to ui/dist (run `make build-ui`). When dist only
5// contains the committed .gitkeep placeholder, the server still compiles and
6// answers with an explanatory error page instead of the SPA.
7package ui
8
9import (
10 "embed"
11 "io/fs"
12)
13
14//go:embed all:dist
15var dist embed.FS
16
17// Dist returns the embedded SPA build as a filesystem rooted at the dist
18// directory, i.e. index.html lives at the root of the returned fs.FS.
19//
20// Example:
21//
22// http.Handle("/", http.FileServerFS(ui.Dist()))
23func Dist() fs.FS {
24 sub, err := fs.Sub(dist, "dist")
25 if err != nil {
26 // The dist directory is embedded at compile time; its absence is a
27 // build-system bug, not a runtime condition a caller could handle.
28 panic(err)
29 }
30 return sub
31}