feat: frontend shell — project picker, legend, modals (new project / cable type / delete), URL ?project= state
This commit is contained in:
23
web/web.go
Normal file
23
web/web.go
Normal file
@@ -0,0 +1,23 @@
|
||||
// Package web bundles the frontend (HTML/JS/CSS) into the Go binary
|
||||
// via embed.FS so deploying mCables means shipping one file.
|
||||
package web
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"io/fs"
|
||||
)
|
||||
|
||||
//go:embed all:static
|
||||
var assets embed.FS
|
||||
|
||||
// Static returns the frontend filesystem rooted at the package's static/
|
||||
// dir so callers see index.html at "/".
|
||||
func Static() fs.FS {
|
||||
sub, err := fs.Sub(assets, "static")
|
||||
if err != nil {
|
||||
// embed sub-rooting can only fail if "static" doesn't exist,
|
||||
// which is a build-time error. Panic is the right shape.
|
||||
panic(err)
|
||||
}
|
||||
return sub
|
||||
}
|
||||
Reference in New Issue
Block a user