Online Cloud Function Development
Cloud Development Platform provides the capability for online cloud function development without configuring a local development environment, enabling online development, debugging, and deployment of cloud functions.
Enter the Online Development Environment
By clicking the 'Online Development' button on the Cloud Function Service details page, you can enter the online development environment.
Cloud environment preparation may be required before entering the environment.
Workspace Introduction
Upon entering the online development environment, you will arrive at a workspace similar to the following. The editor interface of this workspace environment is identical to VSCode
, supporting functions such as code editing, debugging, and terminal.
The following figure describes the main content of the File Browser Area
:
cloudrunfunctions
Directory
The function code storage directory for
Function Cloud Hostingis
cloudrunfunctions. Right-click on this directory to perform operations such as
Createand
Synchronize Listfor
Function Cloud Hosting`.
Synchronize List
Click the [Function Cloud Hosting] Synchronize List
button to synchronize the cloud function list. After synchronization is complete, the synchronization status information will be displayed below.
Create Cloud Function
Click the [Function Cloud Hosting] Create
button to pop up a dialog box. Enter the cloud function name to create the cloud function.
cloudrunfunctions/{function_name}
Directory
The function code storage directory for
Function Cloud Hostingis
cloudrunfunctions/{function_name}. Under this directory, you can perform operations such as
Debugand
Deploy`.
Write Cloud Function Code
You can write code in the online editor interface. For how to write code for Function-based Cloud Hosting
, refer to the Function Writing Guide.
Run Cloud Function Code
The online development environment supports an integrated terminal, allowing cloud function code to be run via the terminal.
After successful startup, you can open the browser from the bottom right corner.
Debug Cloud Function
After writing the function code, click the [Function Cloud Hosting] Debug
button to start debugging.
If an error occurs when starting debugging, you can check the error cause through the console output and fix it.
After debugging is completed, you can proceed with the deployment of the cloud function.