Skip to content

Deploy an app

A runtime app is a deployable Next/V8 isolate application that runs on Comwit Cloud. You create an app inside a project, upload a build (a packaged copy of your compiled app), and Comwit makes that build live. If a new build misbehaves, you can roll back to a previous one. This page walks through the whole loop end to end.

An app lives inside a project. Creating one only registers the app — it does not deploy anything yet. Give it a name (for example, web):

Create an app
comwit apps create --project <projectId> --name web

The equivalent API call posts a small JSON body:

API
POST /v1/projects/{projectId}/apps { "name": "web" }

List the apps in a project, or fetch a single one to see its current state:

List apps
comwit apps list --project <projectId>
API
GET /v1/projects/{projectId}/apps { "apps": [...] }
GET /v1/projects/{projectId}/apps/{appId}
DELETE /v1/projects/{projectId}/apps/{appId}

An app resource carries these fields:

  • app_id — the app’s identifier (you pass this as --app <appId>).
  • name — the human-readable name you chose.
  • active_build_id — the build that is currently live (empty until your first deploy).
  • builds — the list of builds you have uploaded.

Deploying uploads a build artifact and activates it. The simplest form points the CLI at your build output directory:

Deploy a directory
comwit deploy --project <projectId> --app <appId> --package ./dist

The --package value can be either:

  • A built directory — the CLI packs it locally with tar --zstd into a temporary .tar.zst archive before uploading.
  • A prebuilt .tar.zst file — upload it as-is.

You can configure hostnames, the runtime environment, and concurrency at deploy time:

Deploy with options
comwit deploy \
--project <projectId> \
--app <appId> \
--package ./dist \
--host a.example.com,b.example.com \
--env-ref brrrd/env/app \
--max-concurrent-requests 100
  • --host a.example.com,b.example.com — bind one or more hostnames on this deploy (comma-separated).
  • --env-ref <ref> — a runtime environment reference.
  • --max-concurrent-requests <n> — the runtime concurrency cap.

The CLI calls the deployments route under the hood:

API
POST /v1/projects/{projectId}/apps/{appId}/deployments

A successful deploy returns:

Response
{ "app_id": "app-xxx", "build_id": "build-yyy", "hosts": [], "uploaded": true }

The new build_id is the build you just uploaded; it becomes the app’s active_build_id.

Every deploy creates a build, and Comwit keeps the history so you can return to a known-good one. List the builds for an app:

List builds
comwit apps builds --project <projectId> --app <appId>
API
GET /v1/projects/{projectId}/apps/{appId}/builds
POST /v1/projects/{projectId}/apps/{appId}/rollbacks

A rollback re-activates a prior build without re-uploading an artifact — it flips the live build pointer back to a build you already deployed, so it is fast and does not require you to repackage anything.