Skip to content
Get started

zel serve

Serve what build produced, with nothing watching and nothing rebuilding.

terminal
zel build
zel serve ./dist

Why not just use zel dev

Because they answer different questions.

zel dev runs the application. It resolves routes, renders on demand, and is forgiving in ways the finished site is not. serve hands over files from a folder exactly as a CDN would, and nothing else.

A static build can differ from the development server, and the differences are the kind that reach production:

Trailing slashes/guide and /guide/ are the same route in dev, and two different files on a CDN
Missing assetsSomething the export did not copy is served from memory in dev
Absolute pathsA link that works from the root breaks under a basePath
A page needing a serverAnything dynamic silently became a 404 during export

Seeing the export in a browser once, before it goes anywhere, catches all four in about a minute. It is the cheapest step in the whole pipeline and the one most often skipped.

What it does

Serves --out from zel build over HTTP, with the same route-to-file mapping a static host uses:

/            → index.html
/guide       → guide.html
/guide/setup → guide/setup.html
anything else → 404.html

No watching, no rebuilding, no cache-busting. Change a file and the browser shows the change on reload, because it is reading the file.

Options

[dir]The folder to servedist
--port <n>3000

Until it lands

Any static server behaves the same way. From the folder:

terminal
python3 -m http.server 3000 --directory dist

For a container image, zel image run is the equivalent and works today.

See also