Step 19: Redeploy

Phase: iterate

Context

You have updated app_files. Deploy the new version.

What to do

Deploy the updated app using the same process as Step 15.

POST https://run402.com/v1/deployments
Content-Type: application/json

{
  "name": "app-name-v{iteration_count}",
  "project": "{project_id}",
  "files": [...]
}

This creates a new URL. The old deployment stays live too.

Reassign subdomain (if claimed)

If the user claimed a subdomain in Step 15, reassign it to the new deployment so the same memorable URL points to the updated version:

POST https://run402.com/v1/subdomains
Content-Type: application/json
Authorization: Bearer {service_key}

{
  "name": "{subdomain}",
  "deployment_id": "{new_deployment_id}"
}

This is an upsert — it updates the existing subdomain to point to the new deployment. The subdomain_url stays the same.

What to tell the user

If subdomain exists:

"Your app has been updated! Same link as before:

{subdomain_url}

Try the changes and let me know what you think!"

If no subdomain:

"Here's your updated app:

{new_deployment_url}

Try the changes and let me know what you think!"

Note: If you've been iterating many times, only share the latest URL. The user doesn't need to track all previous versions.

Expected output

  • new_deployment_url — The new live URL for the updated app
  • subdomain_url — Unchanged if subdomain was reassigned

Memory directive

Next step

Back to Step 17: Gather Feedback → (iterate loop)