canopy:write.
Asset format
assets maps site-relative file paths to file descriptors:
encoding defaults to utf-8 and may be base64. Use base64 for images, fonts, archives, and other binary files.
Asset paths are site-relative. Include every referenced CSS, JavaScript, image, font, and data file in the asset map.
Create a site
POST /canopy/sites
name and assets are required. spa defaults to false.
The response is 201 Created and includes a revision_id and revision_status. Save the revision ID for status checks.
Redeploy a site
PATCH /canopy/sites/:name
assets is required. Redeploy with the complete asset map for the desired site version. Treat the request as the next published site state rather than a partial file patch.
List and inspect
GET /canopy/sitesreturns{ "sites": [...] }.GET /canopy/sites/:namereturns one site record.
canopy:read.
Delete
DELETE /canopy/sites/:name requires canopy:delete and returns 204 No Content.
Publish checklist
- Include
index.html. - Check path casing in every reference.
- Use
base64for binary assets. - Enable
spaif browser-side routing owns application paths. - Poll status before promoting the new site URL.
