# Introduction
Tencent Cloud provides free, reliable development and production environments that make it easier for developers to build Mini Programs.
NodeJS
and PHP
languages are supported at server side. You can set up both the server and Mini Program with the Weixin DevTools.
# Development Environment
- Free to use;
- Automatic assignment of secondary domain name for test:
xxxxxxx.qcloud.la
; - Free and automatic deployment of
HTTPS
; - Only used for online debugging and not for publishing;
- Separates code deployment/running and database from production;
- Connects to Weixin DevTools to allow quick deployment, debugging, restart and restoration of code.
# Production Environment
- Users need to purchase Tencent Cloud domain names or use the existing ones;
- Free and automatic deployment of
HTTPS
; - Only used for online publishing and not for debugging;
- Uploads code with Weixin DevTools and deploys code with the Tencent Cloud Console. The separation between upload and publishing reduces the risk of misoperation.
# Logging in to Tencent Cloud via Weixin Official Accounts Platform
Open Weixin Official Accounts Platform to register and log in to the Mini Program by following the steps below:
- Click Settings on the left menu.
- Click Weixin DevTools tab on the right.
- Click Tencent Cloud to enter the Tencent Cloud tool page, and then click Activate.
- Scan the code with the Weixin account bound to the Mini Program to bind the Mini Program to Tencent Cloud. After activation, you'll automatically go to the Tencent Cloud Weixin Mini Program Console and find the development environment has been activated.
Note: At this point, you cannot see the "Enabled" status of Tencent Cloud under the Weixin DevTools. The "Enabled" status is synced to the Weixin DevTools only after the first deployment of the development environment.
# Installing Weixin DevTools
Download and install the latest version of Weixin DevTools, and log in to it by scanning the QR code with the Weixin account bound to the Mini Program.
# Importing NodeJS DEMO and Configuration
Open the Weixin DevTools, and then click Mini Program Project.
Enter the Mini Program’s AppID, select an empty directory for the project directory, select Create Tencent Cloud Node.js Launch Template, and then click OK to create a Mini Program project.
Install dependencies
You are recommended to stall dependencies locally to make debugging easier. You can also ignore this step and install dependencies online by selecting Install Dependencies in the Tencent Cloud menu in the DevTools.
Open the CMD in the directory you just selected to install dependencies:
cd server && npm install
Click the Tencent Cloud icon on the upper right corner of the page and then select Upload Test Codein the drop-down menu.
For the first use, select Module Upload and select all the options, and then select Automatically install dependencies after deployment. Click OK to upload the code. After modifying the code for server side, you're recommended to select Intelligent Upload to only upload the modified portion of the code.
After uploading the code, click Details on the upper right corner, and then select Tencent Cloud Status to see the development environment domain name assigned to you:
When you use the Tencent Cloud Mini Program service for the first time, you need to copy the development environment's full request domain name (including
https://
), then open theclient/config.js
file in an editor to paste the domain name to thehost
line and save. Then the editor will automatically compile the Mini Program and a client Demo will appear on the simulator window on the left:Click Login in the simulator. When Login successful appears, the NodeJS environment is enabled and you can start other development tasks.
# Importing PHP DEMO and Configuration
Open the Weixin DevTools, and then click Mini Program Project.
Note: If the NodeJS environment has been enabled for your Mini Program, click the Details button on the upper right corner, select Tencent Cloud Status, and then click Switch Language.
You can switch the language in the Tencent Cloud Console
Enter the Mini Program’s AppID, select an empty directory for the project directory, select Create Tencent Cloud PHP Launch Template, and then click OK to create a Mini Program project.
Click OK again to enter the DevTools.
Click the Tencent Cloud icon on the upper right corner of the page and then select Upload Test Codein the drop-down menu.
After uploading the code, click Details on the upper right corner, and then select Tencent Cloud Status to see the development environment domain name assigned to you.
Copy the development environment's full request domain name (including
https://
), then open theclient/config.js
file in an editor to paste the domain name to thehost
line and save. Then the editor will automatically compile the Mini Program and a client Demo will appear on the simulator window on the left.Click Login in the simulator. When Login successful appears, the NodeJS environment is enabled and you can start other development tasks.
# Other Development Documents
Documents on server/client Demos, and SDK:
- Development and Production Environments
- Self-Deployment
- One-Stop Deployment
- FAQs
- How do I deploy code to the development environment?
- How do I restart the server?
- How do I restore and re-initialize the environment?
- How do I debug back-end code remotely?
- How do I view the back-end logs?
- How do I modify the database password?
- How do I create and modify database tables?
- How do I upload images?
- How do I deploy a Demo to my server?
- How do I create a new route quickly?
- How do I configure the API for pushing customer service notifications at the Weixin back-end?
- How do I connect and work with databases with server SDK?
- How do I set up a development environment locally?
- Server SDK Documentation
- Server SDK API Documentation
- Client SDK Documentation