Actual combat | how to deploy flash project using wechat cloud hosting

Time:2021-7-30

1、 Project introduction

The project is a company’s official website developed with flash framework and Tencent cloud CMS. Its main function is to request through requestsCloud development CMSThe data provided is then rendered to the page.

Software architecture

  1. Front end UI framework:layui
  2. Server:flask
  3. Backend API:Cloud development CMS

2、 Deployment project

Wechat cloud hosting deployment flash project

1. Clone the project locally (or download the compressed package directly)
https://github.com/hzjsj/flaskProject.git

2. VisitWechat cloud hosting official website, create a cloud environment, select the service list, and then create a new service

Actual combat | how to deploy flash project using wechat cloud hosting

3. In the service list, click manage to enter the service details page, and click new version in the version list option

Actual combat | how to deploy flash project using wechat cloud hosting

Here you can select the code library to pull. You need to authorize your own GitHub, gitlab or gitlab. You need to upload the current project code to your own git warehouse.

Actual combat | how to deploy flash project using wechat cloud hosting

You can also choose to upload from the local code, enter the project root directory to compress the file and upload the compressed package.
4. After the new version status is normal, you can publish the project under the deployment publishing option

Actual combat | how to deploy flash project using wechat cloud hosting

5. In the service list option, click service details to see the public domain name, copy it to the browser and open it

Actual combat | how to deploy flash project using wechat cloud hosting

6. The container loading process is slow during the first access. After the access is successful, you can see the following figure

Actual combat | how to deploy flash project using wechat cloud hosting

Here, the project is successfully deployed. The back-end API accesses the domain name. To replace it, you also need to install the cloud development CMS

Cloud development CMS extension installation

1. Check the official installation documents

https://docs.cloudbase.net/cms/install/extension.html

After successful installation, you can see the access address and administrator account password in the extended basic information option

2. Access the address, log in to the background and create a project

Actual combat | how to deploy flash project using wechat cloud hosting

3. In the content model, click Import model and upload the flash-project.json file under the project root directory

Actual combat | how to deploy flash project using wechat cloud hosting

4. Configure access permissions in project settings (you need to go to system settings first, open API access, and maintain the configuration path)

Actual combat | how to deploy flash project using wechat cloud hosting

5. Configure the main.py file in the root directory of the project

headers = {
    'Authorization': 'Bearer API_TOKEN'
}
api = ''

Copy the above access link and fill it in the API, so that it can be configured. Finally, add data according to your needs.

You can also set the APIRequest authentication, the API_ Token modify the token created by the system

6. Local debugging, run main.py

http://localhost:8080

After the configuration is completed, just redeploy the project

3、 Project summary

When using wechat cloud hosting, pay attention to writing dockerfile files, which can be viewedOfficial documents of wechat cloud hosting, refer to the sample code to configure the dockerfile file.

Related documents:

Front end UI framework:https://www.layui.com/

Flash document:https://dormousehole.readthedocs.io/en/latest/

Cloud development CMS:https://docs.cloudbase.net/cms/intro.html

API request document:https://docs.cloudbase.net/cms/usage/restful/intro.html#api-qing-qiu

Wechat cloud hosting:https://cloud.weixin.qq.com

Wechat cloud hosting document:https://developers.weixin.qq.com/miniprogram/dev/wxcloudrun/src/basic/guide.html

Author: Yunkai Taoist Master Wang xiulong

Recommended Today

VBS obtains the operating system and its version number

VBS obtains the operating system and its version number ? 1 2 3 4 5 6 7 8 9 10 11 12 ‘************************************** ‘*by r05e ‘* operating system and its version number ‘************************************** strComputer = “.” Set objWMIService = GetObject(“winmgmts:” _  & “{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2”) Set colOperatingSystems = objWMIService.ExecQuery _  (“Select * from […]