Overview
Serverless Web IDE is an IDE for functions launched by Tencent Cloud Serverless in partnership with CODING based on CloudStudio, an integrated development environment for browsers. It delivers an on-cloud development experience comparable to native IDEs.
Serverless Web IDE supports:
Complete function development, deployment, and testing capabilities.
Terminal capabilities. Common development tools such as pip and npm and programming language development environments already supported by SCF are pre-configured in it.
The basic capabilities of a complete IDE, such as smart prompt and code autocomplete.
User-defined IDE configuration, which ensures a consistent IDE user experience for the development of different functions.
Note:
We will keep the personalized configuration and code status in Serverless Web IDE for you. To ensure that function modifications will take effect, deploy the modifications to the cloud in a timely manner.
We recommend you use the latest version of Google Chrome to get the best IDE user experience.
Directions
1. Log in to the SCF console and select Functions on the left sidebar. 2. In the function list, click a function name to enter the function details page.
3. On the Function Management page, select Function Code > Online editing to view and edit the function.
Note:
Online editing is not supported for Java and Go runtime environments currently. When they are used, only developed, compiled, and packaged ZIP packages or binary files can be uploaded. The SCF environment does not provide Java and Go compiling capability. For more information, see Go Deployment Methods and Java Deployment Methods. Overview
This document describes the Serverless Web IDE tool in detail as shown below in order from left to right:
1. Resource Manager
2. File editing section
3. Function operation section
4. Command line terminal
Function Operations
In Serverless Web IDE, you can edit, deploy, and test function code. Common operations such as function testing and deployment and testing template selection are configured in the operation section in the top-right corner of the IDE as shown below:
Function deployment
Serverless Web IDE enables you to deploy a function either manually or automatically and to install dependencies online.
Deployment mode:
Manual deployment: In manual deployment mode, you can trigger function deployment to the cloud by clicking Deploy in the top-right corner of the IDE.
Automatic deployment: In automatic deployment mode, you can trigger function deployment to the cloud by saving the function (pressing Ctrl + S or Command + S).
Online dependency installation: Currently, this feature is supported only for the Node.js runtime environment. After online dependency installation is enabled, dependencies will be installed automatically according to the configuration in package.json
when the function is deployed. For more information, see Online Dependency Installation. Note:
The root directory of the function is /src
, and the deployment operation will package and upload the files in the /src
directory by default. Place the files that you want to deploy to the cloud in the /src
directory.
In automatic deployment mode, you can trigger function deployment to the cloud by saving the function. Therefore, we recommend you not enable automatic deployment for functions with traffic.
You can switch between manual and automatic deployment and enable/disable online dependency installation by selecting from the drop-down list in the operation section in the top-right corner of the IDE. Automatic deployment: Disabled indicates the manual deployment mode.
Function testing
You can click Test in the operation section in the top-right corner of the IDE to trigger the function and view the result in the output.
Select a test template: Click Test templates in the operation section of the IDE to select a function testing triggering event.
Create a test template: If existing test templates cannot meet your testing requirements, you can select Create test template from the test template drop-down list to customize a test event, which will be stored in JSON format in the scf_test_event folder in the /src
root directory of the function and deployed to the cloud with the function as shown below:
Viewing logs
You can view the function testing result in the output, including the returned data Response
, the log Output
, and the function execution summary Summary
.
More Operations
In addition to operations such as function deployment and testing as well as testing template adding, the list expanded by right-clicking the function file in the Resource Manager contains all operations related to the function, including:
Generating serverless.yml
: You can write the current configuration of the function into the serverless.yml
configuration file and use the Serverless Cloud Framework command line tool for further development;
Discarding current modifications: You can re-pull the function deployed in the cloud to overwrite the current workspace.
IDE Operations
The commonly used commands, runtime environments, and preconfigured extensions in Serverless Web IDE are as follows:
Commands
|
python3 | Python 3.7.12`python3` follows the latest Python 3 version by default. |
python37 | Python 3.7.12 |
python36 | Python 3.6.1 |
python27 | Python 2.7.13 |
python | Python 2.7.13 |
node | Node.js 16.13.1The `node` command follows the latest Node.js version by default. Node.js 14.18, 12.16, and 10.15 are also installed in the environment. You can run the `n` command in the terminal to switch the version. |
php80 | PHP 8.0.13 |
php74 | PHP 7.4.26 |
php72 | PHP 7.2.2 |
php56 | PHP 5.6.33 |
php | PHP 7.2.2 |
pip3 | pip 22.0.4 (Python 3.7) |
pip37 | pip 22.0.4 (Python 3.7) |
pip36 | pip 21.3.1 (Python 3.6) |
pip | pip 20.3.4 (Python 2.7) |
npm | 8.1.2 |
composer | 2.2.9 |
|
yarn | 1.22.18 |
wget | 1.14 |
Zip and unzip | 6 |
Git | 2.24.1 |
zsh | 5.0.2 |
dash | 0.5.10.2 |
make | 3.82 |
jupyter | 4.6.3 |
pylint | 1.9.5 |
| 3.2.1 |
Runtime environments
|
Node.js | 16.13, 14.18, 12.16, 10.15 |
Python | 3.7, 3.6, 2.7 |
PHP | 8.0, 7.4, 7.2, and 5.6 |
Extensions
|
Python | 2020.11.371526539 |
Jupyter | 2020.12.411183155 |
PHP-IntelliSense | 2.3.14 |
ESLint | 2.1.13 |
Prettier | 5.8.0 |
Quota Limits
The IDE provides 5 GB of storage space for each user. If it is used up, you will not be able to perform write operations; therefore, clean it up in time. (Deleting functions will not clear the storage space of the IDE. You can back up your workspace changes and manually reset the workspace. You can also choose to switch to the old editor to avoid this restriction.)
To ensure a smooth experience, we recommend you not open more than 3 functions on multiple browser pages at the same time.
Notes
Performing the following operations in the IDE may cause security risks such as data leakage. If you have to perform them, do so with caution:
Install high-risk open-source components such as phpMyAdmin and Struts 2.
FAQs
1. What should I do if an exception occurs during IDE loading?
If IDE cannot be normally started due to a workspace exception, you can click Having problems? in the top-right corner of the IDE and click Reset Workspace on the pop-up page to initialize the workspace.
2. What should I do if the function can be executed successfully in the terminal but fails to be executed after I click Test?
The online IDE terminal and the SCF cloud runtime environment are independent of each other. The execution result returned after you click Test is the actual execution result of the function.
3. What should I do if the result doesn't meet the expectation when I run a command in the terminal?
If you run a dependent package installation command, make sure that you run it under the src
directory.Check the command version before running a command. For the commands supported by default, see Common commands.
Was this page helpful?