Documentation
¶
Overview ¶
Package serve implements a local development server with live-reload, similar to VS Code's Live Server extension.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
Root string // root directory to serve files from
Port int // port to listen on
Host string // host to bind to
Entry string // entry HTML file (e.g. "index.html")
NoOpen bool // if true, don't auto-open in browser
Verbose bool // print request logs
// contains filtered or unexported fields
}
Server is a local HTTP file server with live-reload via WebSocket.
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher watches a directory tree for file changes and calls a callback.
func NewWatcher ¶
NewWatcher creates a new file watcher for the given root directory.
Click to show internal directories.
Click to hide internal directories.