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}.

MethodPathNotes
GET/hosting/healthHealth
GET/hosting/s/{siteId}/Public serve
GET/hosting/s/{siteId}/{*path}Public serve
GET/POST/hosting{pe}/sitesAPI key or owner JWT
GET/PATCH/hosting{pe}/sites/{siteId}API key or owner JWT
GET/POST/hosting{pe}/sites/{siteId}/domainsList or attach a hostname
POST/hosting{pe}/sites/{siteId}/domains/{domainId}:refreshRecheck 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}/releasesCreate release
PUT/hosting{pe}/sites/{siteId}/releases/{releaseId}/files/{*path}Upload file
POST/hosting{pe}/sites/{siteId}/releases/{releaseId}/files:batchBatch upload
POST/hosting{pe}/sites/{siteId}/releases/{releaseId}:finalizeFinalize
POST/hosting{pe}/sites/{siteId}/releases/{releaseId}:promotePromote
POST/hosting{pe}/sites/{siteId}/releases/{releaseId}:rollbackRollback

Clients

PackageRuntime
@vijihub/hostingserver

Implementation

  1. Enable Hosting and Storage on the environment, then create and deploy a site.
  2. In the Hosting console, attach each hostname and add the displayed A record at its DNS provider.
  3. 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.
  4. 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. See docker/nginx/README.md for the edge cutover.
  • Certificate email alerts use the environment's configured Email provider.