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

WeChat small program cloud development The first cloud development small program


May 20, 2021 WeChat Mini Program Development Document


Table of contents


You can quickly get started with cloud development by following these steps.

  1. Create a new cloud development template
  2. Open up cloud development
  3. Experience small programs
  4. View the console

1. Create a new cloud development template

You can also omit this step to get cloud development up and into use directly on existing projects.

Select an empty directory for a new project, fill in the AppID (you must fill in the AppID using cloud development capabilities), check Create a "Cloud Development QuickStart Project" and click Create to get a sample applet that demonstrates the fundamental capabilities of cloud development. This small program is different from a normal QuickStart gadget in that it has the following considerations:

  • No tourist mode, no test number can be used
  • The field cloudfunctionRoot is added to project.config.json to specify the directory where the cloud functions are stored
  • The directory specified by cloudfunctionRoot has a special icon
  • Cloud development capabilities start with base library 2.2.3 support (coverage 97.3%, view compatibility issues)

Starting with the underlying library 2.4.1, cloud development can be used in small program plug-ins, and when using cloud development in plug-ins, cloud resources are used by the plug-in side rather than the host's cloud resources, in the same way that they are used in small programs.

2. Open the cloud to develop and create an environment

After you create your first cloud development snr, you need to turn on cloud development before you can use cloud development capabilities. O n the left side of the developer toolbar, click the "Cloud Development" button to open the cloud console, open cloud development as prompted, and create a cloud environment. T wo environments can be created under the default quota, each isolated from the other, each containing separate resources such as database instances, storage space, cloud function configuration, and so on. Each environment has a unique environment ID identity, and the initially created environment automatically becomes the default environment.

Note: After the appid opens the cloud environment, wait for approximately 10 minutes to use the cloud API, during which the official background service is being prepared, if you try to call the cloud API in the applet, Cloud Init Error: {Errmsg: "INVALID Scope"} error

3. Experience the applet

Once to create the creation environment, you can start the partial basic capability presentation of the applet on the simulator.

4. View the console

The Cloud Development Console is where managing cloud development resources, and the console provides the following capabilities:

  • Operation Analysis: View Cloud Development Monitoring, Quota Usage, User Access
  • Database: Manage databases to view, add, update, find, delete data, manage indexes, manage database access, and more
  • Storage management: View and manage storage space
  • Cloud functions: View the list, configuration, and logs of cloud functions

WeChat small program cloud development The first cloud development small program

Destruction of the environment

To destroy the environment, developers can contact us through a ticket. Please refer to the document "Small Programs and Cloud Development Work orders" for the specific way of submitting work orders.