You are looking at a published site
Published by one HTTP request
Every byte of this page (HTML, CSS, JavaScript, SVG, WebP) travelled as JSON through POST /v1/sites. Poke around. This page is built to teach you how AgentPages behaves.
- 7 files
- no build step
- no external requests
- sandboxed on purpose
checking…
In 12 seconds
Watch it work.
1 · Sandbox lab
Five promises, checked live in your browser.
AgentPages serves every site under Content-Security-Policy: sandbox. That gives this page an opaque origin: it can run scripts, but it cannot touch cookies, storage or other sites. These checks try, and report what really happened.
Running checks…
The fetch check ends with a CORS message in your browser console. That message is the proof: a sandboxed page is not allowed to read its own files with fetch(). Use classic <script src>, relative links and inline data instead.
2 · Publish it yourself
Three ways to put a site online in under a minute.
You need an API key (an operator creates it with agentpages create-key) and the API address. Then pick a path.
- Open
<api-address>/dashboardand sign in with your key. The key stays in that tab's memory only. - Under Publish a folder, choose the
sample-sitefolder (the one this page came from). - Check the summary (hidden files and unsupported types are skipped and listed), then press Publish.
- Open the link it shows. You are now the owner of a copy of this page.
The repo ships a tiny script (standard library only) that turns any folder into the request body, sends it, and prints the URL.
# 1. publish export AGENTPAGES_API_BASE_URL=https://your-api-address export AGENTPAGES_API_KEY=ap_your_key python3 examples/publish_folder.py examples/sample-site # 2. change something, then replace the same site (version goes up by one) python3 examples/publish_folder.py examples/sample-site --update SITE_ID
The smallest possible site is one file. Text goes as utf8, binary files as base64.
curl -s -X POST $API/v1/sites \ -H "Authorization: Bearer $KEY" \ -H 'Content-Type: application/json' \ -d '{"files":[{"path":"index.html","content":"<h1>Hello from curl</h1>"}]}' # {"id":"…","slug":"k3vq7m2xw4tpa5re","url":"…/s/k3vq7m2xw4tpa5re/","version":1}
Want this exact sample site through curl? Let the script print the body and pipe it in:
python3 examples/publish_folder.py examples/sample-site --json \ | curl -s -X POST $API/v1/sites \ -H "Authorization: Bearer $KEY" \ -H 'Content-Type: application/json' -d @-
3 · Break it on purpose
What does the API say when you get it wrong?
Every error has one shape: {"error": {"code", "message"}}. Pick a mistake and see the real status and message the API returns.
Pick a mistake on the left.
4 · Make it yours
Change it, publish again, same address.
Updating replaces the whole site and bumps its version. The URL never changes, and browsers revalidate on every load, so you see your edit immediately.
Try a hue
Slide to re-theme this page right now (46 is the yellow). To keep a change, set --hue at the top of style.css and publish again.
House rules
- Allowed files:
html css js svg png jpg jpeg webp ico txt json - At most 100 files, 1 MiB each, 5 MiB per request.
- Use relative links.
/style.cssbreaks;style.cssworks. - Link folders with a trailing slash: about/ works,
aboutis a 404. - Hidden files (starting with a dot) are rejected.
Ideas to try
- Add
contact/index.htmland link it ascontact/. - Swap
logo.svgfor your own image. - Delete the site from the dashboard and watch its address return a 404.