Deploy Cloud Functions via Console
Online Deployment
You can directly edit and deploy cloud function code in the CloudBase console. If you haven't created a cloud function yet, you can create a blank template cloud function.
- Select the target function in CloudBase Platform/Cloud Functions
- Modify the code in the code editor
- Click "Save and Install Dependencies" to complete deployment

Install Dependencies
Tip
- Currently, only Node.js supports online dependency installation.
- For business security considerations, automatic script execution during dependency installation has been disabled. If the package.json file of the installed dependency package contains script commands such as preinstall, install, or postinstall, an error will be reported during installation. It is recommended to manage dependencies by binding layers or uploading zip packages.
Click "Save and Install Dependencies", and the cloud function backend will check the package.json file in the root directory of the code package and attempt to install dependencies using npm install based on the dependencies listed in it.
Deploy by Uploading Code Package
For more complex projects, you can upload the code after packaging:
- Package the function code and dependencies into a ZIP file
- On the cloud function details page, select "Upload ZIP Package"
- Select the local ZIP file and upload
- Click "Save and Install Dependencies" to complete deployment
Tip
The root directory of the ZIP package should contain the entry file, such as index.js in the Node.js environment.