Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat small program development documentation - Tencent Cloud Support


May 21, 2021 WeChat Mini Program Development Document


Table of contents


Introduced


Tencent Cloud provides developers with a free development and production environment to build your little programs more conveniently, quickly and reliably.

The service side currently supports both NodeJS and PHP languages, and developers can use developer tools to develop both the service side and small programs.

The development environment


  • It's free to use
  • Automatic assignment test with secondary domain name: xxxxxxx.qcloud.la
  • Automatic deployment free HTTPS
  • Can only be used on online debugging, not available
  • Code deployment, running and database and production environment completely separate
  • Open with WeChat development tools, you can deploy, debug, restart, and recover code one-click

Production Environment


  • Free
  • Users need to purchase or use the existing Tencent cloud domain name
  • Automatic deployment free HTTPS
  • Used in online release, not debugging
  • Upload code using WeChat development tools, deploy, upload and release separation in Tencent Cloud Console, reduce the risk of false operation

Log in to Tencent Cloud through WeChat public platform


Open Micro-channel public platform Register and log in to the applet, follow these steps:

  • Click [Settings] on the left menu bar
  • Click [Developer Tools] in the Tab Bar on the right TAB column
  • Click [Tencent Cloud], enter the Tencent Cloud tool page, click [Open]
  • Use the micro-program binding WeChat scan code to authorize the applet to Tencent cloud. After opening, it will automatically enter the Tencent Cloud WeChat applet. The development environment has been opened. You can follow up.

Notice:

At this point, you will not display the Tread of the Tencent Cloud through the applet. It is not displayed. The promised state will be synchronized to the WeChat developer tool after the first deployment development environment.

WeChat small program development documentation - Tencent Cloud Support

WeChat small program development documentation - Tencent Cloud Support

WeChat small program development documentation - Tencent Cloud Support

Install development tool


Download and install the latest version WeChat developer tool , Use the micro-program binding micro-signal scan to log in to the developer tool.

WeChat small program development documentation - Tencent Cloud Support

Import NodeJs Demo and configuration



1. Turn on the second step-installed WeChat developer tool, click the [Small Program Item] button.

2. Enter the applet appid, the project directory selection one Empty catalog Then select [Establish Tencent Cloud Node.js Start Template], click OK to create a small program project.

WeChat small program development documentation - Tencent Cloud Support


3. Install dependence

For local commissioning, it is recommended that you install dependencies locally. You can also skip this step and install the dependency directly online using the "Install Dependency" in the "Tencent Cloud" menu of the developer tool.

Open cmD installation dependency in the directory you just selected:


  1. cd server && npm install
    

    WeChat small program development documentation - Tencent Cloud Support

4. Click on the Tencent Cloud icon in the upper right corner of the interface and select Upload Test Code in the menu bar at the drop-down.


WeChat small program development documentation - Tencent Cloud Support

5. For the first time, use the recommended use, select Module Upload and check all options, then check Auto-Install Dependency after deployment, click OK to start uploading code. After subsequently modifying the service-side code, it is recommended to choose smart upload, the tool only uploads the modified code.

WeChat small program development documentation - Tencent Cloud Support

WeChat small program development documentation - Tencent Cloud Support

6. Once the upload code is complete, click on the Details button in the upper right corner, then select Tencent Cloud Status to see the development environment domain name that Tencent Cloud is automatically assigned to you:

WeChat small program development documentation - Tencent Cloud Support

7. If the current program is the first time using Tencent cloud program https:// development environment request domain client/config.js the editor, the copied host the editor will automatically compile the program, the left simulator window can show the client's Demo in real time:

WeChat small program development documentation - Tencent Cloud Support

8. Click "Login" in the emulator and you'll see that "Login is successful", i.e. you can start your other developments for the completion of the opening.

WeChat small program development documentation - Tencent Cloud Support

Import PHP DEMO and configuration


  1. Open the WeChat developer tool installed in the second step and click on the "Small Program Project" button.

    Tips: Note that if the current small program has opened the NodeJS environment, you need to click on the tool in the upper right corner of the details button, select Tencent cloud status, click switch language

    WeChat small program development documentation - Tencent Cloud Support

    You can choose to switch language environments in the Tencent cloud management background

    WeChat small program development documentation - Tencent Cloud Support

  2. Enter the appID of the applet, select an empty directory from the project directory, then select "Build Tencent Cloud PHP Launch Template" and click to determine the project for creating the small program.

    WeChat small program development documentation - Tencent Cloud Support

  3. Click OK again to enter the developer tool.

    WeChat small program development documentation - Tencent Cloud Support

  4. Click on the Tencent Cloud icon in the upper right corner of the interface and select Upload Test Code in the menu bar at the drop-down.

    WeChat small program development documentation - Tencent Cloud Support

  5. Once the upload code is complete, click on the Details button in the upper right corner, and then select Tencent Cloud Status to see the development environment domain name that Tencent Cloud is automatically assigned to you.

    WeChat small program development documentation - Tencent Cloud Support

  6. Full copy https:// development environment request domain name, and client/config.js in the editor, fill in the host domain name in the host and save, after saving the editor will automatically compile the program, the left simulator window can display the client's Demo in real time. WeChat small program development documentation - Tencent Cloud Support

  7. Click Sign in in the emulator and you'll see that "Login was successful", which means you can start your other developments when you're ready to open.

    ``` WeChat small program development documentation - Tencent Cloud Support

Other specific development documentation


Specific documentation for the service side, the client's Demo, and the SDK: