[bldr]docs
Build APIbldr/node-tools

StaticSiteConfig

How staticSite is configured: a server, plus the site it serves.

interface in bldr/node-tools

How staticSite is configured: a server, plus the site it serves.

Properties

arch: string

property

Platform to select from a multi-architecture image member. Defaults to the architecture of the node the build runs on.

fallback: string

property

Where to send a request that matches no file.

A single-page app needs its shell returned for every unknown path, or a deep link reloads into a 404 — the same rewrite the production hosts do (see each member's serve.json). Defaults to /index.html; React Router's prerender mode emits /__spa-fallback.html instead. Pass null for a plain file server that 404s honestly, which is what a Storybook build wants.

image: any

property

The nginx image — a workspace member, so the digest is pinned and bldr ws sync tracks it. A bare registry reference will not do: scope.addRunnable resolves a service image strictly as a manifest CID.

notFound: string

property

Serve this page, with status 404, for a path that has no file — instead of the fallback with status 200.

For a site that prerenders every route it has (React Router's prerender mode): a path with no file there is genuinely missing, and answering 200 tells every crawler and link checker that it exists. The page is usually the same shell fallback would be, so the not-found route still renders. Leave it unset for an app that routes on the client: there a path with no file is a real page.

port: number

property

The port to serve on, inside the pod and on the host alike.

Kept equal on both sides so that bldr run … -p 9000:8080 means what it looks like. Must be >= 1024: pods are rootless and cannot bind a privileged port, which is why this is not 80. Defaults to 8080.

proxy: ProxyRoute[]

property

Paths this server forwards to a backend instead of serving from disk.

A single-page app that calls an API wants both halves on one origin: the browser then sends no preflight, the API needs no CORS allowance, and the production deployment matches the Vite dev server's server.proxy rather than diverging from it. Each entry is an nginx location — a prefix, or ~ <regex> for a pattern — pointing at a pass URL.

gRPC-web needs nothing special here: it is an ordinary HTTP/1.1 POST that carries its trailers inside the body, so a plain proxy_pass relays it.

See ProxyRoute.

site: Directory

property

The directory to serve, mounted at SITE_ROOT.

See Directory.

On this page