POST /v1/apps/create.
Before you start
- An API Key.
- Enough memory left in your plan. The memory you give an application is taken from the plan, together with your databases.
- Your project as a
.zipfile of at most 100 MB. Thenode_modulesfolders inside it are discarded, so the dependencies are installed again on the platform.
1. Choose how it starts
An application needs one of these two, and the runtime decides what you can use:
Send
startupCommand instead when you need something else, for example npm run start. When you send both, startupCommand is used.
2. Choose the memory
memoryMB is required. It must be at least the platform minimum (256 MB by default) and fit in the memory that is left on your plan. When it does not fit, the request is refused, so list your applications and databases first: both GET /v1/apps and GET /v1/databases return totalUsedRAM.
3. Decide if it is on the web
An application that only runs in the background, like a bot, does not need to be on the web. LeaveexposedViaWeb out.
To put it on the web, send all of these:
exposedViaWeb:true.port: the port your code listens on, from 1 to 65535.assignedSubdomain: lowercase letters, numbers and hyphens, up to 63 characters, not used by another application. The address ishttps://<subdomain>.camposcloud.app.
4. Create it
multipart/form-data, so environmentVariables goes as a JSON encoded string, not as separate fields.
This endpoint accepts one request every 3 seconds. See the limits.
From a GitHub repository
To deploy from a repository instead of a zip, leavefile out and send installationId, repositoryOwner, repositoryName, repositoryId and branch together (all five or none). The installation must be a GitHub App installation linked to your account in the dashboard.
5. Wait until it is ready
A new application starts withstatus: "creating" while the platform prepares it. Read it with GET /v1/apps/{appId} until the status changes:
Then follow the output of the application with
GET /v1/apps/{appId}/logs.
Changing it later
POST /v1/apps/{appId}/update changes only the fields you send. Most changes are not applied right away: the response has restartRequired: true, and the new settings take effect the next time you start or restart the application.
1
Update the settings
Change the memory, the startup command, the port or the variables.
2
Apply them
Call
restart. restartRequired goes back to false.POST /v1/apps/{appId}/upload, which is extracted into the folder you choose, and restart. Single files can be changed with the file system endpoints. To save the files, use GET /v1/apps/{appId}/download.
Next
Databases
Create a database and connect your application to it.
Troubleshooting
The application is offline or the request failed.