---
title: Static site example
description: Deploy a serverless example with one static page and its stylesheet.
slug: /examples/static-site
order: 1
visibility: public
redirects_from: [/examples/static-site-example]
---

<!-- Generated by scripts/build_scaffold_examples.mjs from the scaffold templates. -->

# `static-site` example

Deploy a serverless example with one static page and its stylesheet.

Anyone with the address can read the page. The example saves no application data.

These files come from the same source as the scaffold command. They are the whole site as written; the command installs nothing.

Read the complete starter source under [File contents](#file-contents), or open a text download under [Files](#files). With `read_documentation`, use the file path from the [Files](#files) table as `section`, for example `client/index.html`. To continue the page, use `next_offset` with the same `stamp`.

## With a shell

This template needs no Turn Zero sign-in or token and downloads no library package. Run this in a new project's root:

```text
turnzero scaffold --origin https://dev.turnzero.ai --template static-site
```

Follow the command's next steps. It writes the application in `app/`, without installing dependencies or running tests. [The turnzero command](/cloud/concepts/turnzero-command/#the-static-site-template) explains setup and options.

## From a chat

A Cloud tool name without a prefix is its HTTP API name; your MCP connection lists it with `tzcloud_` before it. Account tools such as `read_rate_card` keep their shorter names. The copied `AGENTS.md` instructions below use the names listed by the MCP connection.

For this example as it stands, follow the calls and checks below. To adapt it, read [Publish a static site](/cloud/guides/publish-a-static-site/).

The scaffold can bind its manifest to an application with `--application <application id>`. From a chat, name the application explicitly in `submit_manifest` and `deploy_files`. The platform uses the application named in the call and checks an uploaded manifest's optional `application` ID only for lowercase UUID form. `turnzero deploy --origin https://dev.turnzero.ai` and `turnzero check --origin https://dev.turnzero.ai` refuse a folder whose manifest names another application.

Keep the application paths shown in the table. The download URLs end in `.txt` so a browser reads the code instead of running it; that suffix is not part of the application filename. Each file is also reproduced below for tools reading this page through MCP.

For a new application, make these calls in order.

1. Call `tzcloud_create_application` with `name` and `kind: "serverless"`, without `size`. Keep its returned `application.id` for later calls.
2. Call `tzcloud_submit_manifest` with `application` and the complete `manifest` object.
3. Call `read_rate_card` and explain the expected usage charges before deploying. Follow the manifest answer’s cost guidance.
4. Call `tzcloud_deploy_files` with `application`, `environment: "production"` and the complete `files` list of `path` and `content`.
5. If the deploy is still running, call `tzcloud_read_status` with `application` and `wait_seconds: 45` until it ends. Read the outcome; stop if it failed.

## Check it works

Call `tzcloud_check_deploy` with `application`. For the other calls below, pass that application ID and `environment: "production"`.

- Call `tzcloud_request_route` with `path: "/"`; expect 200 and the page’s HTML.
- Call `tzcloud_request_route` with `path: "/styles.css"`; expect 200 and the stylesheet.
- Report these results. This static site needs no log read.

These reads do not check the page’s appearance in a browser. Tell the person what these checks leave untested and who can read and write, as described above.

## Files

Paths are relative to the application root, the folder containing `manifest.json` and `client/`. `deploy_files` uses these paths without an `app/` prefix.

| Application path | Read source |
| --- | --- |
| `.gitignore` | [Text](/cloud/examples/static-site/files/gitignore.txt) |
| `AGENTS.md` | [Text](/cloud/examples/static-site/files/AGENTS.md.txt) |
| `client/index.html` | [Text](/cloud/examples/static-site/files/client/index.html.txt) |
| `client/styles.css` | [Text](/cloud/examples/static-site/files/client/styles.css.txt) |
| `manifest.json` | [Text](/cloud/examples/static-site/files/manifest.json.txt) |

## File contents

### .gitignore

```text
node_modules/
.env
.env.*
```

### AGENTS.md

```text
# This service runs on Turn Zero Cloud

The service in this folder is hosted on Turn Zero Cloud. It started from the platform's `static-site` template: a static site whose pages, styles and other files are served without a server of the application's own. This file describes the template the service started from: keep it current as the service changes.

## Where you build

- Edit the files under `client/`.
- A file's path below `client/` is its path on the site; `/` serves `client/index.html`.

## Where the rules are

Your AI coding tool reads Turn Zero Cloud's rules through the `turnzero` MCP server. That connection gives the tool access to the products on your account. Read the current rules there because they change with the platform.

- Where the server is not connected, set up Turn Zero Cloud first: https://dev.turnzero.ai/cloud/getting-started/set-up/
- Before you change or deploy this service, read the server's `deploy` skill.

## What you run here

- A local run and a deploy: the `deploy` skill gives each step and the line to run, in this order: `tzcloud_submit_manifest`, the local run, `tzcloud_deploy_command`.
- Read Publish a static site through `read_documentation` at `/cloud/guides/publish-a-static-site/`.
```

### client/index.html

```html
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Static site</title>
  <link rel="stylesheet" href="styles.css">
</head>
<body>
  <main>
    <h1>Your static site</h1>
    <p>Turn Zero Cloud serves this page from <code>client/index.html</code>. Its styles come from <code>client/styles.css</code>.</p>
  </main>
</body>
</html>
```

### client/styles.css

```css
/* client/styles.css, which client/index.html links beside it */
:root {
  color-scheme: light dark;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
}

body {
  margin: 0 auto;
  max-width: 40rem;
  padding: 2rem 1rem;
}

h1 {
  font-size: 1.75rem;
  margin: 0 0 1rem;
}

code {
  font-family: ui-monospace, monospace;
}
```

### manifest.json

```json
{
  "manifest_version": 1,
  "services": [],
  "region": "usa",
  "egress": [],
  "audience": { "kind": "public" },
  "packages": []
}
```

