orchard
mirrorEvery site I host, in one repo, along with the Cloudflare Tunnel and Caddy that front them. It's all Go, Vite, and SQLite, and it runs on a desktop at home with nothing listening on an inbound port.
blogbuncaddycloudflare-tunneldockergogolanghomelabhtml-templatemonorepoself-hostedseosqlitestatic-sitetypstuptime-monitoringviteweb-analytics
1//go:build !embed
2
3package main
4
5import (
6 "io/fs"
7 "os"
8)
9
10// A development build reads the Vite bundle off disk, so `bun run dev` can
11// rewrite build/dist under a running server. A build tag rather than a runtime
12// check, because //go:embed needs the directory to exist at compile time.
13func distFS() fs.FS {
14 if d := os.Getenv("SITE_DIST"); d != "" {
15 return os.DirFS(d)
16 }
17 return os.DirFS("build/dist")
18}