Documentation
¶
Overview ¶
Package cmd serves the web UI, and the server's configuration, which it reads, beside the API, when the server is built with the "frontend" tag, which embeds the UI, once it's built, with npm, into frontend/app/dist, which make does. Without it, such as with go install, the server serves its API and configuration, without the UI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Flags ¶
type Flags struct {
UI bool `name:"ui" help:"Serve the web UI from this server, when it's built in." default:"true" negatable:""`
}
Flags are the web UI's flags
func (*Flags) RegisterUI ¶
func (f *Flags) RegisterUI(ctx server.Cmd, log *slog.Logger, router *httprouter.Router, openapi bool, opts ...config.Opt) (bool, error)
RegisterUI registers the server's configuration, at /config.json, and the web UI, at /, when it's built in, unless it isn't to be served. When openapi is true, the configuration says where the API's documentation is. The options add the modules' sections to the configuration. Returns true when the UI is served, so the server doesn't register its own handler of /.