Documentation
¶
Index ¶
- func FindAvailablePort(startPort int, maxAttempts int) (int, error)
- func FormatTemplateHtml(opts FormatOptions) (string, error)
- func Init(fs embed.FS, tmpl string)
- func ProxyDev(mux *http.ServeMux) error
- func RegisterAPI(mux *http.ServeMux) error
- func Serve(port int, dev bool) error
- func ServeComponent(port int, opts ServeOptions) error
- func Static(mux *http.ServeMux, opts StaticOptions) error
- type FormatOptions
- type ServeOptions
- type StaticOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindAvailablePort ¶
FindAvailablePort finds a port starting from startPort
func FormatTemplateHtml ¶
func FormatTemplateHtml(opts FormatOptions) (string, error)
FormatTemplateHtml formats the template HTML with the given options
func RegisterAPI ¶
func ServeComponent ¶
func ServeComponent(port int, opts ServeOptions) error
Types ¶
type FormatOptions ¶
type FormatOptions struct {
Title string // __TITLE__ placeholder
Render string // __RENDER__ placeholder (default: "renderComponent")
Component string // __COMPONENT__ placeholder (mandatory)
ComponentProps string // __COMPONENT_PROPS__ placeholder (default: "{}")
}
FormatOptions contains the options for formatting the template HTML
type ServeOptions ¶
type StaticOptions ¶
type StaticOptions struct {
IndexHtml string // Custom HTML content to serve instead of embedded index.html
}
Click to show internal directories.
Click to hide internal directories.