Documentation
¶
Overview ¶
Package devserver implements `anetos dev`: it watches the project, regenerates code (templ, anetos gen), rebuilds and restarts the app on every change, and serves it through a reverse proxy on a stable address that reloads open pages when the new version is up, or shows the build error.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
Dir string // project root (with go.mod)
Addr string // proxy address, e.g. ":8080"
Args []string // app arguments; default "run"
Poll time.Duration // how often to look for changes; default 300ms
Out io.Writer // progress and the app's output
OnListen func(addr string)
// Hosts are the host names (without port) browsers may use besides
// localhost, *.localhost and IP addresses, such as APP_URL's
// ("blog.test"). Others get 403: a page on another site can't reach
// the dev server by pointing its own name at 127.0.0.1 (DNS
// rebinding).
Hosts []string
}
Options configures Run.
Click to show internal directories.
Click to hide internal directories.