All Products
Search
Document Center

Mobile Platform as a Service:Quick start

Last Updated:Nov 20, 2024

The steps to develop a Mini Program are as follows:

  1. Download IDE

  2. Create a Mini Program

  3. Download the configuration file

  4. Login to the Mini Program IDE

  5. Select the associated Mini program

  6. Edit the code

  7. Upload the Mini Program

  8. Release the Mini Program

Download IDE

Download the Mini Program developer tool (IDE):

Create a Mini Program

  1. After downloading and installing the Mini Program IDE, open the IDE, click Mini Program from the list on the left, and click + on the right to open the creation page, click mPaaS and Select Templet.

    de8c815fa172405753cb3dd16d7d9be9.png

  2. Set Project Name and Project Path in the project creation page, then click Finish to create the Mini Program.

    Important
    • We recommend that you use a node version earlier than v18 for the uniapp template. Because uniapp templates may have compatibility issues with newer versions of node, it is recommended to use earlier node versions to avoid potential issues.

    • The steps of dependency installation wit YARN are as follows:

      1. Open the command line tool and go to the root directory where the project is located.

      2. Run the yarn install command.

      After you perform the preceding operations, the required dependencies are installed and the development environment is started. Then, you can develop and debug the uniapp project.

    Download the configuration file

    Each time you create a new environment, you need to upload the IDE configuration file of the corresponding Mini Program downloaded from the console.

    1. Log on to the mPaaS console. In the left-side navigation pane, choose Mini Program > Mini Program Release > Manage Configuration. On the page that appears, click Manage IDE Configuration and click Download Configuration File to download the IDE configuration file.

      Note

      The IDE configuration file is different from the configuration file of the mPaaS application.

      2.jpg

    2. After you click Download Configuration File, the Download Configuration File dialog box appears. You must enter a password in the Dynamic Password field. The password is going to be used to log on to the IDE.

      Note

      The default name of the downloaded configuration file is config.json.

    Login to the Mini Program IDE

    You can login to the Mini Program IDE in two ways:

    Dynamic password logon method

    1. In the Mini Program IDE, click Log On in the upper-right corner.

    2. If there is no logon environment has been created, the Add Environment window appears. If a logon environment has been created, the Logon window appears.

      • If you are creating a logon environment for the first time, enter the environment name in the current window and upload the mini program IDE configuration file (config.json file) downloaded from the mPaaS console. image.png

      • If you have created a logon environment, click the environment selection menu at the top of the window, choose + Add Environment at the bottom of the menu, enter an environment name, and then upload the Mini Program IDE configuration file (config.json file) downloaded from the mPaaS console.

        image.png

    3. Click OK to create a new logon environment.

    4. After successfully adding the logon environment, in the log on window, enter the account and password to log on.

      • An account is the username used to log on to the Aliyun console.

      • The password is the dynamic password that you set when you download the configuration file.

      image.png

    Aliyun AccessKey logon method

    Important

    If you use the Aliyun AccessKey, you must upgrade mPaaS Mini Program IDE to version 2.9 or later.

    1. Move the pointer over the profile image in the upper-right corner of the Alibaba Cloud console and click AccessKey Management to enable Aliyun AccessKey.

      image.png

      Important
      • You can use the AccessKey pair of an Alibaba Cloud account or a RAM user to call API operations.

      • If you use the AccessKey pair of an Alibaba Cloud account to call API operations, you must create an AccessKey pair.

      • We recommend that you use the AccessKey pair of RAM user instead of an Alibaba Cloud account to call API operations because RAM user permissions are controllable and easy to manage.

    2. Click Use AccessKey Pair of RAM user.

      image.png

    3. Click Create User. The Create User page appears.

      image.png

    4. Set Logon Name and Display Name, select OpenAPI Access, and then click OK.

      image.png

    5. Copy and keep the generated AccessKey ID and AccessKey secret. If the AccessKey ID and AccessKey secret are not copied, you can generate them again.

      image.png

    6. Click Add Permissions in the Actions column. The Add Permissions page appears.

      image.png

    7. In the Select Permissions search box, enter MpaaSFullAccess, and select a AliyunMpaaSFullAccess, then click OK. Add mPaaS permissions to the created user.

      image.png

    8. Open the configuration file that you downloaded in the editor, enter the following content, and save the file:

      {
       // The content of the original configuration file,
        "openapi": {
          "type": "aliyun",
          "accessKeyId": "AccessKey ID generated in step 5",
          "accessKeySecret": "The AccessKey secret generated in step 5",
          "endpoint": "mpaas.cn-hangzhou.aliyuncs.com",
          "userId": "Username entered in Step 5"
        }
      }

      1.jpg

    9. In the mPaaS mini program IDE, click Login to open the logon page.

      1

    10. Click + Add Environment to open the Add Logon Environment page.

      2

    11. Enter an environment name in the Environment Name field, upload the configuration file configured in Step 8, and then click OK.

      3It shows Aliyun AccessKey in the Logon dialog box, then click Login.

      image.png

    Select the Associated Mini Program

    After you log on to the IDE, click Choose App in the upper-left corner and select the Mini Program that you created in the console from the drop-down list.

    image.png

    Edit the code

    After selecting the associated Mini Program, you can start editing the code.

    image.png

    Upload Mini Program

    After you edit the code, click Upload in the upper-right corner of the IDE to upload the Mini Program to the mPaaS console.

    image.png

    Release the Mini Program

    Log on to the mPaaS console. In the left-side navigation pane, choose Mini Program > Release Mii Program. For more information, see Release a Mini Program package.