README ¶ fserver Installation go get -u github.com/no-src/fserver Quick Start package main import ( "embed" "github.com/no-src/fserver" "github.com/no-src/log" ) // webDist the web dist resource // //go:embed dist var webDist embed.FS func main() { defer log.Close() exit, port := fserver.InitFlag(printVersion, printAboutInfo) if exit { return } fserver.Run(port, "/dist", webDist) } func printVersion() { log.Log("version info") } func printAboutInfo() { log.Log("about info") } Expand ▾ Collapse ▴ Documentation ¶ Index ¶ func InitFlag(versionFunc, aboutFunc func()) (exit bool, port int) func Run(port int, pathPrefix string, dist embed.FS) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func InitFlag ¶ func InitFlag(versionFunc, aboutFunc func()) (exit bool, port int) InitFlag init the default flags func Run ¶ func Run(port int, pathPrefix string, dist embed.FS) Run start the static file web server Types ¶ This section is empty. Source Files ¶ View all Source files browser.goflag.goserver.go Click to show internal directories. Click to hide internal directories.