You need to enable JavaScript to run this app.
Volcano Engine Function as a Service

Volcano Engine Function as a Service

Copy page
Download PDF
Web service
Deploying an Express.js application with a few clicks
Copy page
Download PDF
Deploying an Express.js application with a few clicks
This topic describes how to deploy an Express application with a few clicks via the veFaaS application center.​
Background information​
  • Application introduction​
  • Uses a custom Native runtime to quickly deploy an Express application that users can access over the public network. After deployment, users can access the application through the domain name provided by the API Gateway trigger.​
  • Runtime​
  • Native runtime​
  • Associated cloud services​
  • veFaaS: Uses the corresponding runtime template to build a web application.​
  • API Gateway: Uses the gateway service to expose the public domain name of the web application.​
Prerequisites​
  • All the cloud services associated with the application have been activated.​
  • The VeFaaSFullAccess, APIGFullAccess, and STSAssumeRoleAccess policies have been attached to Identity and Access Management (IAM) users. If one of the preceding policies is not attached, contact the root user or the administrator for authorization. For specific operations, refer to Creating a user and granting permissions.​
  • An APIG instance has been created in APIG. For detailed operations, see Creating instances.​
  • If you use veFaaS for the first time, make sure that the cross-service authorization is complete. If the authorization is not complete, the cross-service authorization page will appear, which provides guidance on authorization.​
Procedure​
  1. Log in to the veFaaS console.​
  1. In the top navigation bar, select the target region.​
  1. In the left navigation bar, click App.​
  1. On the My app page, click Create app.​
  1. On the Create application page, select the Express template and click Create.​
  1. On the Create App page, specify the following information as required.​
  • Basic information​
  • ​
    Parameter​
    Description​
    Selected template​
    Displays the selected template. The Express is used in this scenario.​
    Name​
    Specify a custom name for the application.​
    Description​
    Enter the description of the application. This parameter can be left empty.​
    IAM role​
    The Application Center provides the system default role ServerlessApplicationRole, which is granted permissions on some cloud resources that the Application Center needs to access.​
    • If your user roles do not contain this role, this role will be automatically added.​
    • If your user roles contain this role, the system will automatically detect whether all the policies required for the application are attached to this role. If a required policy is not attached, the console will display the name of the policy. You can click Add policy to add the policy.​
    warning​
    • Make sure that the IAMReadOnlyAccess policy is attached to IAM users. Otherwise, they will not be authorized to obtain information about the ServerlessApplicationRole role.​
    • If IAM users need to attach policies to the ServerlessApplicationRole role, make sure that the IAMFullAccess policy is attached to the IAM users.​
    Associated cloud services​
    Displays the names, activation status, and activation purposes of all the cloud services that the current application needs to use.​
    ​
  • Advanced settings​
  • ​
    Parameter​
    Description​
    Region​
    The region where the application and its associated cloud resources are located.​
    Function Name​
    Specify a custom name for the function.​
    API Gateway instance​
    Select the target API Gateway instance. The resources related to the API Gateway trigger, including services, Upstream, and routes, will be automatically created for this API Gateway instance.​
    ​
  1. Click Confirm to create and deploy the application. The system will automatically redirect to the application details page and display the application deployment logs in real time.​
Validating results​
After the application is successfully deployed, in the cloud resources list, click the access address under the API Gateway to access the HTML page returned by the Express application.​
​alt​​
What to do next​
This topic only demonstrates the simplest example of deploying an Express application. If you wish to perform secondary development on the application, refer to the following steps.​
  1. In the cloud resources list on the application details page, click the + next to veFaaS to view the function information corresponding to the application.​
  1. Click the function name to go to the function details page.​
  1. Switch to the Code tab. Edit the function code and publish a new version of the function without redeploying the application.​
  • The code structure is as follows:​
  • ​
    # The static directory contains the static page resource files displayed by the express application template.​
    --static​
    --index.html​
    --style.css​
    # The node_modules dependencies for the express application​
    --node_modules​
    --xxx​
    ...​
    # The node directory contains the node runtime package required by the custom native runtime.​
    --node​
    --xx​
    ...​
    # The index.js is the entry file, used to write the business logic of the Express application.​
    --index.js​
    # The package.json keeps a list of dependencies, and more.​
    --package.json​
    # package-lock.json​
    --package-lock.json​
    # The run.sh is the startup file, required for native runtime functions, and has the corresponding startup command configured.​
    --run.sh​
    ​
​
Last updated: 2026.08.19 14:06:07