Docs Layers

Routes

Live on testnetRuns on NEAR

A release can declare routes: a pattern, a collection and a template sealed in the same release. The contract fills the template inside web4_get, so a page is complete HTML without JavaScript. Templates escape every value.

Setting

quay.json
"routes": [
  { "pattern": "/", "kind": "list", "collection": "posts", "template": "templates/home.html", "limit": 10, "order": "desc" },
  { "pattern": "/posts/:id", "kind": "doc", "collection": "posts", "template": "templates/post.html" },
  { "pattern": "/api/posts", "kind": "json", "collection": "posts" }
]

How Harbour Board uses it

  1. / lists the posts with pinned posts first and the latest digest.
  2. /posts/:id renders one post, and /api/posts returns JSON.
  3. A hidden post is absent from both, and /posts/9 answers 404.

Proof on testnet

A server-rendered post/posts/5
The JSON route/api/posts
The hidden spam post/posts/9 answers 404

Check it without a key: quay up --dry-run checks every route and template before anything is sent. The view helper is in the repository README, and scripts/judge.sh runs these checks.

What you trust

Routes run inside your contract. Rolling back a release rolls back its routes and templates with it, and never your data.

Limits

OutputEscaped values only. There is no raw HTML output.

Every flag is in the command reference, generated from quay up --help.