Skip to content

Multi-file Deploys

Instead of a single HTML string, you can deploy an entire file tree — separate HTML pages, CSS stylesheets, JavaScript modules, images, and fonts. Each file is uploaded and served from a CDN at its path under your subdomain.

The files Array Format

Pass a files array to the deploy or update tool. Each entry has:

FieldTypeRequiredDescription
pathstringYesFile path relative to site root (e.g. index.html, css/style.css)
contentstringYesFile content (UTF-8 text or base64 for binary)
contentTypestringYesMIME type (e.g. text/html, text/css, image/png)
encoding"utf-8" | "base64"NoUse "base64" for binary files. Defaults to "utf-8".

Example: Two-Page Site

deploy called with files:
  - path: index.html       contentType: text/html
  - path: about.html       contentType: text/html
  - path: css/style.css    contentType: text/css
  - path: js/app.js        contentType: application/javascript

You would ask Claude to deploy this with something like:

"Deploy a two-page site — a home page and an about page — with separate CSS and JS. Use the slug 'my-site'."

The result:

Deployed successfully!

URL: https://my-site.based.page
ID: dep_abc123

The files are served at:

  • https://my-site.based.page/index.html
  • https://my-site.based.page/aboutabout.html (or about/)
  • https://my-site.based.page/css/style.css
  • https://my-site.based.page/js/app.js

Path Resolution

  • index.html at the root is served for /
  • about.html at the root is served for /about and /about/
  • Subdirectory index.html (e.g. blog/index.html) is served for /blog/
  • All other paths are served at their exact path

Binary Files (Images, Fonts)

For binary files, encode the content as base64 and set encoding: "base64":

json
{
  "path": "images/logo.png",
  "content": "iVBORw0KGgoAAAANSUhEUgAA...",
  "contentType": "image/png",
  "encoding": "base64"
}

Claude can handle base64 encoding automatically when given image data.

Updating a Multi-file Site

Calling update with a new files array replaces all existing files. If you want to keep existing files, include them in the new array.

"Update my-site — add a blog page and update the navigation links in index.html and about.html."

Claude calls update with all files including the new blog.html and the updated versions of the existing pages.

SPA Mode

For single-page apps built with React Router, Vue Router, or similar, enable is_spa: true:

deploy called with:
  files: [{ path: "index.html", ... }, { path: "assets/app.js", ... }]
  is_spa: true

With is_spa enabled, any 404 request falls back to index.html, allowing client-side routing to handle the path.

See React & Frameworks for a full React deployment example.

Common MIME Types

ExtensionContent-Type
.htmltext/html
.csstext/css
.jsapplication/javascript
.jsonapplication/json
.pngimage/png
.jpgimage/jpeg
.svgimage/svg+xml
.woff2font/woff2
.icoimage/x-icon

Notes

  • File paths must not start with /. Use index.html, not /index.html.
  • There is no maximum file count, but keep individual file sizes reasonable (under 10MB each).
  • files and html are mutually exclusive in a single deploy call.
  • When updating, the new files array completely replaces the previous file set.

Deploy apps from conversation.