# Introduction
Tencent Cloud provides developers with a free development environment and production environment, making it easier, faster, and more reliable to build your Mini Program.
NodeJS
and PHP
are currently supported on the server, and developers can use the developer toolkit for both server and Mini Program development.
# Development environment
- Free to use.
- Automatically allocate second-level domains for test:
xxxxxxx.qcloud.la
- Automatically deploy
HTTPS
for free - It is only used for on-line debugging and cannot be released.
- Code deployment, running and database are completely separated from the production environment.
- Unified with Weixin development tools, it can be used to deploy, debug, restart and restore codes with one click.
# Production environment
- Users need to buy or use the existing Tencent Cloud domain names.
- Automatically deploy
HTTPS
for free - It is used for on-line release and cannot be debugged.
- Upload codes with Weixin development tools, operate and deploy in the Tencent Cloud console to separate the upload and release, reducing the risk of incorrect action.
# Log in to the Tencent Cloud after authorized by the Weixin Official Account Platform
Open the Weixin Official Account Platform to register and log in the Mini Program, and follow these steps:
- Click "Settings" in the left menu bar.
- Click "Developer Toolkit" in the Tab bar on the right.
- Click "Tencent Cloud" to enter the Tencent Cloud Tools page, and click "Activate".
- Grant the Mini Program access to the Tencent Cloud by scanning QR code of the Weixin whose ID is bound to the Mini Program. After activation, you will be directed to the Weixin Mini Program console on the Tencent Cloud. When it indicates the state as activated, you can proceed with the operation.
Note: At this time, the Tencent Cloud status viewed via the Mini Program developer toolkit is not shown as activated. The activated status will be synchronized to the Weixin developer toolkit after first deployment of the development environment.
# Install development tools
Download and install the latest version of the Weixin Developer Toolkit, scan the QR code with the Weixin whose ID is linked to the Mini Program to log in to the Developer Toolkit.
# Import NodeJS DEMO and configure
Open the Weixin developer toolkit installed in step 2 and click the "Mini Program Project" button.
Enter the AppID for the Mini Program, select an empty directory as the project directory, select "Create Tencent Cloud Node.js Startup Template", and click "OK" to create a Mini Program project.
Install dependencies
To facilitate local debugging, it is recommended to install dependencies locally. You can also skip this step and directly install the dependencies online using "Installation Dependencies" under "Tencent Cloud" menu in the developer toolkit.
Open CMD to install dependencies in the directory you just selected:
cd server && npm install
Click the "Tencent Cloud" icon in the upper right of the interface and select "Upload Test Codes" in the drop-down menu bar.
For the first use, it is recommended to select "Module Upload" and check all options. And then check "Automatically Install Dependencies after Deployment" and click "OK" to start code upload. After modifying the server codes later, it is recommended to select intelligent upload. The tool can only be used to upload modified codes.
After uploading the codes, click the "Details" button in the upper right, and select "Tencent Cloud Status" to see the development environment's domain name automatically assigned to you by Tencent Cloud:
If this is the first time for the current Mini Program to use Tencent Cloud Mini Program service, it needs to completely copy (including
https://
) the 'request' domain name of the development environment, open theclient/config.js
file in the editor, fill in thehost
with the copied domain name and save it. After saving, the editor will automatically compile the Mini Program. The Demo of the client can be displayed on the left emulator window in real time:Click "Login" in the emulator. If "Login Successful" is shown, the activation is completed, and then you can start other development.
# Import the PHP DEMO and configure
Open the Weixin developer toolkit installed in step 2 and click the "Mini Program Project" button.
tips: It is important to note, if the NodeJS environment is activated for the current Mini Program, you need click the details button in the upper right of the tool, select the Tencent Cloud status, and click to switch languages.
You can choose to switch the language environment in the management backstage of the Tencent Cloud.
Enter the AppID for the Mini Program, select an empty directory as the project directory, select "Create Tencent Cloud PHP Startup Template", and click "OK" to create a Mini Program project.
Click "OK" again to enter the developer toolkit.
Click the "Tencent Cloud" icon in the upper right of the interface and select "Upload Test Codes" in the drop-down menu bar.
After uploading the codes, click the "Details" button in the upper right, and select "Tencent Cloud Status" to see the development environment domain name automatically assigned to you by Tencent Cloud.
Completely copy (including
https://
) the 'request' domain name of the development environment, open theclient/config.js
file in the editor, fill in thehost
with the copied domain name and save it. After saving, the editor will automatically compile the Mini Program. The Demo of the client can be displayed on the left emulator window in real time.Click "Login" in the emulator. If "Login Successful" is shown, the activation is completed, and then you can start other development.
# Other specific development documents
Specific documents about Demo and SDK for the server and client:
- Development environment and production environment
- Self deployment
- One-stop deployment
- FAQ
- How to deploy codes to a development environment
- How to restart servers
- How to restore initialization environments
- How to debug backstage codes remotely
- How to view backstage logs
- How to change database passwords
- How to create and modify database tables
- How to upload pictures
- How to deploy a Demo to your server
- How to quickly create new routes
- How to configure customer service message push interfaces in the backstage of Weixin
- How to connect and operate a database using server SDK
- How to build a development environment locally
- Server SDK documentation
- Server SDK API documentation
- Client SDK documentation