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.
Create an app
Section titled “Create an app”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):
comwit apps create --project <projectId> --name webThe equivalent API call posts a small JSON body:
POST /v1/projects/{projectId}/apps { "name": "web" }List and inspect apps
Section titled “List and inspect apps”List the apps in a project, or fetch a single one to see its current state:
comwit apps list --project <projectId>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.
Deploy a build
Section titled “Deploy a build”Deploying uploads a build artifact and activates it. The simplest form points the CLI at your build output directory:
comwit deploy --project <projectId> --app <appId> --package ./distThe --package value can be either:
- A built directory — the CLI packs it locally with
tar --zstdinto a temporary.tar.zstarchive before uploading. - A prebuilt
.tar.zstfile — upload it as-is.
Optional deploy flags
Section titled “Optional deploy flags”You can configure hostnames, the runtime environment, and concurrency at deploy time:
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 deploy API
Section titled “The deploy API”The CLI calls the deployments route under the hood:
POST /v1/projects/{projectId}/apps/{appId}/deploymentsA successful deploy returns:
{ "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.
List builds and roll back
Section titled “List builds and roll back”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:
comwit apps builds --project <projectId> --app <appId>GET /v1/projects/{projectId}/apps/{appId}/buildsPOST /v1/projects/{projectId}/apps/{appId}/rollbacksA 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.
Next steps
Section titled “Next steps”- Set runtime configuration with environment variables.
- Attach your own hostnames in Custom hostnames.
- Wire deploys into your pipeline with CI/CD.