Skip to content

hamur preview --check

hamur preview --check [root] is a smoke test of a build. It starts the built output with the runner hamur preview uses, on a free port, requests / and every prerendered path of .output/hamur.json, prints one line per path, stops the server and exits.

sh
hamur build
hamur preview --check

Each line is the status and the path, for example 200 /about. The exit code is 0 when no answer is a 5xx; otherwise it is 1 and the last line says why, for example Check failed: / answered 500. A server that does not answer within 30 seconds, or that exits first, also exits 1. The server is stopped on every outcome, also on Ctrl-C.

Only presets with a local runner are checked: bun, node and its host aliases, bun-compile, standard, node-middleware and the static family. Any other preset exits 1 and prints its preview command, for example hamur preview --check has no local runner for the "cloudflare" preset; its preview command is: bunx wrangler dev --config .output/wrangler.json, rather than starting a tool you may not have installed. --port, --host, --dotenv and --mode apply as they do to hamur preview.