Hosting
Overview
Host static sites with versioned releases: upload files, finalize, promote, and rollback. Public traffic is served under /hosting/s/{siteId}/….
API
Sites can attach multiple custom hostnames. Create each hostname's A record using the IPv4 value shown in the Hosting console, then check DNS; HTTPS is issued automatically after verification.
{pe} = /projects/{projectId}/environments/{environmentId}.
| Method | Path | Notes |
|---|---|---|
| GET | /hosting/health | Health |
| GET | /hosting/s/{siteId}/ | Public serve |
| GET | /hosting/s/{siteId}/{*path} | Public serve |
| GET/POST | /hosting{pe}/sites | API key or owner JWT |
| GET/PATCH | /hosting{pe}/sites/{siteId} | API key or owner JWT |
| GET/POST | /hosting{pe}/sites/{siteId}/domains | List or attach a hostname |
| POST | /hosting{pe}/sites/{siteId}/domains/{domainId}:refresh | Recheck A record and HTTPS certificate |
| PATCH/DELETE | /hosting{pe}/sites/{siteId}/domains/{domainId} | Set auto-renew or remove hostname |
| GET/POST | /hosting{pe}/sites/{siteId}/releases | Create release |
| PUT | /hosting{pe}/sites/{siteId}/releases/{releaseId}/files/{*path} | Upload file |
| POST | /hosting{pe}/sites/{siteId}/releases/{releaseId}/files:batch | Batch upload |
| POST | /hosting{pe}/sites/{siteId}/releases/{releaseId}:finalize | Finalize |
| POST | /hosting{pe}/sites/{siteId}/releases/{releaseId}:promote | Promote |
| POST | /hosting{pe}/sites/{siteId}/releases/{releaseId}:rollback | Rollback |
Clients
| Package | Runtime |
|---|---|
@vijihub/hosting | server |
Implementation
- Enable Hosting and Storage on the environment, then create and deploy a site.
- In the Hosting console, attach each hostname and add the displayed A record at its DNS provider.
- Recheck DNS after it resolves to the configured VijiHub IPv4 address. HTTPS is obtained on the first check/request and renewed by the public Caddy edge.
- Use the active custom hostname or the VijiHub URL
/api/hosting/s/{siteId}/to share the site. Use rollback to restore a previous release.
Constraints
- Management APIs require API key or owner JWT.
- Public serve routes are anonymous — only publish content you intend to expose.
- Large uploads should use batch endpoints; finalize before promote.
- Production custom domains require
HOSTING_CUSTOM_DOMAIN_IPV4, public access to ports 80 and 443, and the Compose Caddy edge. Seedocker/nginx/README.mdfor the edge cutover. - Certificate email alerts use the environment's configured Email provider.