This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index at /llms.txt, or add .md to any page's URL.
Recipe: a website
A website in Exact: when a page is made, how to serve it, and a setting.
bun exact.mjs pattern site writes a tested one: a list built ahead, a page per item
rendered for each request, and an API's origin as a setting
(the site starter).
Build a website
Paste this into Claude, Cursor, Codex, or another agent.
A route's render says when its page is made:
Policy | Made | Fits |
|---|---|---|
render=build | by web-build | what the build has: docs, a landing page, a list in app.ts |
render=request | by serve, per request | a live API's data, at each visit |
render=cached | by serve, kept 60 s | an API's answer every reader may share for a while |
render=client, the default | in the browser, after its script | one reader's own, behind a sign-in |
The starter's planet page is render=request: its figures are a live API's, and a build
makes a parameterised route's pages only from a pages= list. serve sends it whole, with
its data.
The server has no visitor: --render js leaves credentialed reads pending for
the browser to ask after adoption, in TypeScript, declared sources and Rust.
Public TypeScript reads may use credentials: 'omit'.
See web sessions and source rendering.
See serving and hosting for the build, development server and static hosting, including a mount such as /app/.
Each tag is the HTML element it names, so the landmarks and roles are the browser's: main,
nav aria-label, a header and footer beside main (banner, contentinfo), section aria-labelledby (a region), h1–h6, table with caption, th scope and aria-sort,
dl, select, input type="search", link href (an a), image "src" alt="" (an
img). Use list for links or cards: it supplies the item roles and keeps each link's
role. A field's label is a text id= the field names with aria-labelledby.
curl a page serve renders to read it.
An analytics script or site-wide JSON-LD goes in app.json's host.web.head, which every
page's <head> carries (bun exact.mjs docs head tags).
An API's origin is read at build:
text
app.json "env": ["API_BASE_URL"]
app.ts export const API = import.meta.env.API_BASE_URL;
export const grants = `net.fetch ${API}`;
.env API_BASE_URL=http://127.0.0.1:8787
The value is the environment's, else .env.local's (out of git), else .env's, else a
default written after the read (?? 'https://…'); with none the build fails. Every host
inlines it in the module: it is public, never a secret. A value changed since the
build makes test, agent, web and serve build again.
/planet/7#details opens the page at its id="details" once its data arrives. Write
it path("planet", id) + "#details", or link href="#details" on that page;
fragment(top(nav)) reads it, and a test opens there with at "/planet/7#details". A query
follows the path: path("home") + `?q=${encodeURIComponent(v)}` (raw, A&B reads back
A), read with searchParam(top(nav), "q").
Is this helpful
Last updated November 18, 2026