Next: Invoking haunt publish
, Previous: Invoking haunt build
, Up: Command-line Interface [Contents][Index]
haunt serve
The haunt serve
command allows one to quickly view a local
preview of the generated website before publishing the finished
product to a remote web server. When haunt serve
runs, a
local HTTP server is spawned. Visit the server using a web browser to
inspect the results of the build. By default, the web server listens
on port 8080, so the URL to visit would be
http://localhost:8080.
While developing, it is common to rebuild the site frequently to view
the results of incremental changes. Rather than manually running
haunt build
(Invoking haunt build
) each time changes
are made, the --watch
flag can be used to automatically rebuild
the site when a source file changes on disk.
--config=configuration-file
-c configuration-file
Load the Haunt site declaration from configuration-file.
--port=port
-p port
Listen for HTTP requests on port. Defaults to 8080.
--host=host
-p host
Listen for HTTP requests on host. Accepts an IP address (IPv4
or IPv6), localhost
or loopback
to serve on the local
loopback device (the default), or any
to bind on all local
available ports (useful if you want to show off your website to
someone else on your LAN, or something.)
--watch
-w
Automatically rebuild the site when source files change.