// Package web embeds the static pages served by wxch-server: // the control UI (index.html), the chat page and the notepad. package web import ( "embed" "io/fs" ) //go:embed static var content embed.FS // private holds pages that are only handed out behind a login (design notes and the like). They live apart from // static/ because everything in static/ is served to anyone on the control host. // //go:embed private var private embed.FS // FS returns the pages with the "static" folder as its root. func FS() fs.FS { sub, err := fs.Sub(content, "static") if err != nil { panic(err) // the folder is embedded at build time, so this cannot happen } return sub } // PrivateFS returns the pages that need a login, with the "private" folder as its root. func PrivateFS() fs.FS { sub, err := fs.Sub(private, "private") if err != nil { panic(err) } return sub }