Uploading a new application
api.applications.create(file) uploads a zip and creates a brand-new application. The file argument is either a local file path or a Buffer.
UPLOAD_FAILED (upload could not be processed), STORAGE_UPLOAD_FAILED (storage backend rejected the file), INSUFFICIENT_MEMORY (plan doesn’t have enough RAM available) and FILE_TOO_LARGE (413, zip over the size limit).
The zip must contain at least:
- Main file — entry point of your application
- Dependencies file —
package.json,requirements.txt, etc. squarecloud.app— configuration file with name, description, main file, version, etc. See the config file guide
Committing files to an existing application
app.commit(file, fileName?) uploads files into an already-deployed application. Pass a zip to replace multiple files at once, or a single file to update just that one.
Under the hood, the API accepts a
path query parameter to control where the commit is written; the SDK sends it for you.
- Commit a single file (Buffer)
- Commit a zip from disk
- Commit a file by path
UPLOAD_FAILED, STORAGE_UPLOAD_FAILED, INSUFFICIENT_MEMORY, FILE_TOO_LARGE (413), UPLOAD_ABORTED (the client aborted the upload) and COMMIT_FAILED.
