How to attach an app to a hosting plan
View as MarkdownAttach your app to a web hosting subscription to enable publishing.
Overview
Subscription attachment is required before going live for Node.js apps.
Before you can publish a Node.js app to production, you must attach it to a web hosting subscription. This operation is synchronous and returns immediately on success.
Subscriptions are purchased separately in your GoDaddy account. After attachment, the app is bound to that subscription's infrastructure and billing. This article describes how to attach a hosting plan to your web app.
Go to Deploy your Node.js app for the full deployment walkthrough (which includes this procedure).
Prerequisites
The following prerequisites are required before you can attach a hosting plan to your app:
- a Personal Access Token with the
hosting.subscription:writescope - a hosting app already created
Go to Deploy your Node.js app for instructions to create a hosting app.
- a web hosting subscription ID from your GoDaddy account
Attach an app to a subscription
PUT /apps/{appId}/subscription attaches a created app to a hosting plan. The subscription must belong to your account and have available capacity. Success returns 200 OK with the subscription attachment details. After you complete this procedure, you can publish your app.
-
Attach the app:
curl -s -X PUT "$BASE_URL/v1/hosting/apps/$APP_ID/subscription" \ -H "Authorization: Bearer $GODADDY_PAT" \ -H "Content-Type: application/json" \ -d '{ "subscriptionId": "'$SUBSCRIPTION_ID'" }'
Common errors
The following table lists common errors when attaching:
| Status | Cause | Action |
|---|---|---|
400 | Invalid app ID or subscription ID | Verify both IDs are correct and belong to your account |
401 | Expired or revoked PAT, or missing scope | Go to Hosting core concepts for the scopes you need |
404 | App or subscription not found | Confirm the app exists and the subscription ID is on your account |
409 | No capacity available on the subscription | The subscription has no available capacity. Verify the subscription supports additional apps or contact GoDaddy support |
Agent & Automation Notes
hosting.subscription:writeRelated
API References
Guides
Concepts
Tutorials
Last updated on
How is this guide?