serve.md
serve
uid: guides.commands.serve description: Preview a built site over HTTP.
Serves a built site folder over HTTP until interrupted.
docgen serve [folder] [options]| Argument | Description |
|---|---|
folder | The site folder to serve. Defaults to _site. |
| Option | Description |
|---|---|
-n, --hostname <host> | The host to listen on. Defaults to localhost. |
-p, --port <number> | The port to listen on. Defaults to 8080. |
A request for a folder serves its index.html. Addresses the site does not have receive the site's 404.html. Requests whose decoded path would leave the folder are refused.
Example
pudu run examples/Cli.pudu serve website/_site --port 8130To rebuild while editing, use build with --serve --watch instead: serve only serves files that already exist.
