Managing Static Hosting with the CLI
Viewing Static Website Service Information
You can use the following command to display the static website's status, access domain, and other information.
cloudbase hosting detail -e envId
Deploy Files
You can use the following command to upload files to a specified path in the static website's storage space. When cloudPath is not specified, the CLI will upload files to the root directory.
cloudbase hosting deploy localPath cloudPath -e envId
# Deploy Files in the Current Directory to the Root Directory
cloudbase hosting deploy . -e envId
# Deploy the index.js file in the static directory to static/index.js
cloudbase hosting deploy ./static/index.js static/index.js -e envId
Deleting Files and Folders
You can use the following command to delete files in the storage space of your static website:
cloudbase hosting delete cloudPath -e envId
You can use the following command to delete folders in the storage space of your static website:
cloudbase hosting delete -d cloudPath -e envId
Listing Files
You can use the following command to deploy and display files in the static website storage space.
cloudbase hosting list -e envId
In Windows systems, localPath
follows the local path format, which is recognizable by the system and typically uses the \
separator. cloudPath
is a cloud file path and must use the /
separator.
localPath
is the path of a local file or folder, in the form ofdirectory/filename
, such as./index.js
,static/css/index.css
, etc.cloudPath
is the path of the file or folder relative to the root directory, in the form ofdirectory/filename
, such asindex.js
,static/css/index.js
, etc.