Home  >  Article  >  WeChat Applet  >  How to correctly deploy mini programs to online environments

How to correctly deploy mini programs to online environments

王林
王林forward
2021-03-10 09:55:493974browse

How to correctly deploy mini programs to online environments

Specific steps to deploy WeChat Mini Program to the online environment:

1. WeChat Mini Program application

Apply and authenticate (uncertified cannot Release, certification requires 300 yuan, currently only supports enterprise certification) See the official website for details.

https://mp.weixin.qq.com/cgi-bin/registermidpage?action=index&lang=zh_CN

2. Development end preparation

1. To develop a WeChat applet, you must have an AppId. If you don’t have one, you can register one.

Log in after applying

https://mp.weixin.qq.com/Enter the registration page, click above to register immediately.

#2. Click to select “Mini Program” and the registration page will appear.

#3. Fill in the account information, including email, password, and verification code.

4. Log in to your email and click the link to verify.

#5. Enter the information registration interface and register information, which is divided into "subject information registration" and "administrator information registration". "The subject information cannot be modified after submission"!

6. Log in to the WeChat applet.

#7. Settings, developer settings, APPID, server domain name.

#8. Settings, developer tools, Tencent Cloud.

9. Install developer tools

Download and install the client WeChat developer tools and use the mini program WeChat ID to scan the QR code to log in. Select the applet project on the left, then select the project directory, your AppID and project name.

##Mini program project management If there is no project in the project directory, use step 10 to download the test code and enter the following picture:

10. Download the test code

Download the Demo code packaged for you. As needed to activate the environment, you can download it from Tencent Cloud.

#11. The download is a compressed package, which contains the code files of the server and the client. Then import the entire folder into WeChat Developer Tools.

12. Use WeChat developer tools to create a mini program project, select the code folder downloaded in the third step, and modify some configuration information of the cloud database. Open the server/config.js or server/config.php file. Change the MySQL database password inside to your mini program AppID.


13. Upload test code

Use WeChat developer tools to upload code, complete the initialization of the development environment, and upload test code selection (dependencies are automatically installed after deployment).

#14. After the code is uploaded, perform code deployment. Click "Code Deployment" in the picture

15. Modify the local request domain name

Click [Details]-[in the upper right corner of the WeChat Developer Tools Tencent Cloud Status] to view [Development Environment Request Domain Name], copy the domain name, fill it in the host of the clien/config.js file, and save it.

3. Tencent Cloud preparation

1. Deploy the WeChat applet to the online environment. First, Tencent Cloud must be associated with the WeChat applet, otherwise it cannot open up the development environment; second, it must have a registered domain name; and finally, a cloud host. The domain name deployed by Tencent Cloud for WeChat mini programs must be registered, otherwise it cannot be accessed normally.

2. Tencent Cloud Hosting is about 49 yuan per month. It does not support Java and .NET but supports PHP and Node.js.

#3. If you meet the above conditions, you can enter the production environment. As shown in the picture.

Related recommendations: 小program development tutorial

The above is the detailed content of How to correctly deploy mini programs to online environments. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete