Files
skillshare/internal/server/embed_dev.go
T
Willie d30d90af76 feat: update Homebrew install to homebrew-core and detect missing UI
- Update Homebrew command from tap (runkids/tap/skillshare) to
  homebrew-core (brew install skillshare) in README, website homepage,
  and getting-started docs
- Add note that Homebrew build is CLI-only (no web dashboard)
- Add IsUIBuilt() detection in embed.go/embed_dev.go to check for
  placeholder UI at startup
- Show CLI warning with install instructions when skillshare ui is
  run on a build without the frontend
- Add Homebrew Note section to commands/ui.md with migration steps
2026-02-15 16:18:26 +08:00

31 lines
856 B
Go

//go:build dev
package server
import (
"net/http"
)
// IsUIBuilt reports whether the embedded dist contains a real frontend build.
// In dev mode, the frontend is served by Vite, not embedded.
func IsUIBuilt() bool {
return false
}
// spaHandler returns a placeholder handler when building with -tags dev.
// In dev mode, use the Vite dev server on :5173 instead.
func spaHandler() http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/html; charset=utf-8")
w.Write([]byte(`<!DOCTYPE html>
<html>
<head><title>Skillshare UI (dev)</title></head>
<body>
<h1>Skillshare UI — Dev Mode</h1>
<p>The frontend is served by Vite at <a href="http://localhost:5173">localhost:5173</a>.</p>
<p>Or run <code>make ui-build</code> to embed the built frontend.</p>
</body>
</html>`))
})
}