Documentation
¶
Overview ¶
Package server provides the live preview HTTP server. It watches files with fsnotify and pushes reload notifications over WebSocket.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// Configuration
Host string // Listening host or IP.
Port int // Listening port.
WatchDir string // Source directory to watch.
OutputDir string // Output directory.
AutoOpen bool // Whether to open the browser automatically.
// BuildFunc is provided by the caller and rebuilds the project output.
BuildFunc func() error
// contains filtered or unexported fields
}
Server implements the live preview server.
func (*Server) ListenFrom ¶
ListenFrom reserves the first available port from startPort upward.
Click to show internal directories.
Click to hide internal directories.