当前位置:网站首页>"Wechat cloud hosting" first practical battle | introduction to minimalist demo
"Wechat cloud hosting" first practical battle | introduction to minimalist demo
2022-06-24 08:28:00 【Tencent cloud development TCB】
One 、 Project introduction
This project is based on wechat cloud hosting capability , Built a simple WEB The back-end service , Statistics WEB The access log of the web page , And save to serverless In form mysql In the database , Then the service interface is invoked in the small program , Access times .
The project includes the basic ability of wechat cloud hosting in single operation , Contains the underlying container 、mysql、 Wechat applet call, etc .
Project technology stack : The back-end service (nodejs + express)、WEB Webpage ( Native js)、 Wechat applet ( Native )
If you have experienced the basic ability of wechat cloud hosting , We can continue to experience the related use of wechat cloud hosting in other Tencent cloud products , Log monitoring and other capabilities .
Two 、 Deployment process
(1) visit github Warehouse , Download the project locally , open IDE Prepare to transform the project
(2) visit Wechat cloud hosting official website , Scan code with wechat , Choose the small program you want to use , Enter the start of creation .
(3) Here you can fill in the name of the environment according to your own use , General small program project can create an environment , An environment can contain multiple services , It can meet most of the needs of enterprises .
(4) If you've used cloud development in your app before , And logged on the official website of Tencent cloud, configured other cloud products of Tencent cloud , For ease of use , In the create box 「 Network type 」 Choose a private network , Configure the cloud hosting environment to the same network environment as before ( If you don't want to do it or you haven't done anything , Directly create the system by default )
(5) Know the cost of cloud hosting environment , And agree to the terms of service , Start to create .
(6) Once created , The following effect will be displayed :
(7) Start to create mysql database , As shown in the figure below :
(8) After filling in the password ,mysql Initialization in progress , Please pay attention to the cost information here , After initialization, as shown in the figure below :
(9) Click on the top right corner 「 Database management 」 Button , Enter the database management background , Start creating a library , As shown in the figure below , It's called the library online ( Name at will , If you change it, pay attention to the corresponding changes in the operation )
(10) Put the project in the directory database.sql File import to online In the library , The effect is as follows :
(11) Return to wechat cloud hosting console ,mysql Add an account to the , Dedicated to programming calls , As shown in the figure below :
(12) In the catalog werunserver/db.json in , Fill in mysql database information , among host and port The information is in the console
{
"host": "10.0.224.13",// Before the colon in the picture above ip Address
"user": "code", // The account name set in the previous step
"password": "*****", // The password set in the previous step
"port": "3306", // The number after the colon in the picture above
"database": "online" // Previously created database online
}(13) Save the project , Put the project directory werunserver As root , Upload private git Warehouse , It's been github For example .【 Attention must be paid to werunserver For root
(14) On the wechat cloud hosting console , In the service bar , Select new service , As shown in the figure below , Remember to check open public access , Set your name as you like ( The example here is aaa)
(15) After creation , Enter service management , As shown in the figure below , Select new pipeline
(16) The new configuration of the pipeline is as follows , The code source needs to be authorized the first time it is used :
(17) After new creation , As shown in the figure below , Click to start the first build :
(18) After building , The following states , At this point, we can start the release process
(19) Go to 「 Deployment of release 」 Start the full release process
(20) After the release, the effect is as follows :
(21) Back to the list of services , Find the public address in the service details , Copy to browser to open :
(22) Because the configuration is low-cost mode , So there is a container loading process for the first access , Just wait patiently ( In the process of continuous refresh, the request failure box will appear for about tens of seconds , In the normal configuration network , harmless ) After successful visit, the effect is as follows , Every time you refresh, there will be a record :
(23) Start the test of wechat app , In the project miniprogram As the root directory of the app, use wechat developer tool to import and open , Fill in the first step and create a small program with the same service APPID
(24) Open it in the applet developer tool pages/index/index.js file , Fill in the following information :
(25) Rerun , Be accomplished !
3、 ... and 、 Project summary
After this deployment practice , You can continue to make changes based on this project , Push the update code back to the warehouse , The pipeline will automatically trigger the build .
Before the release of the new version , It can be fully tested , Cloud hosting provides various test whitelist configurations ; After testing and verification, gray scale publishing can be carried out , Finally arrive 100% New version orders , Complete the full replacement of the new version ; If it's too much trouble , Believe in yourself , It can be released in full , Have a good time !
In the future, more functions such as user-defined domain name will be supported in the console , Still on the way , Remember to check for updates .
Experience wechat cloud hosting now :https://cloud.weixin.qq.com/cloudrun/
Wechat cloud hosting official Community
Suggestions and problems in the process of using wechat cloud hosting , Welcome to the official community to interact with us :https://developers.weixin.qq.com/community/minihome/mixflow/1919566493118201863
Cloud hosting official exchange group
边栏推荐
- Dart development server, do I have a fever?
- Catégorie de prêt 5
- WCF TCP protocol transmission
- More appropriate development mode under epidemic situation
- 独立站运营中如何提升客户留存率?客户细分很重要!
- The applet reads more than 20 data, and the cloud function reads more than 100 restrictions
- 小样本故障诊断 - 注意力机制代码 - BiGRU代码解析实现
- 2022茶艺师(中级)上岗证题库及在线模拟考试
- 新准则金融资产三分类:AMC、FVOCI和FVTPL
- 13 -- 移除无效的括号
猜你喜欢

Question 3 - MessageBox pop-up box, modify the default background color

jwt(json web token)

2022 mobile crane driver special operation certificate examination question bank and online simulation examination

JUC个人简单笔记

Opencv实现图像的基本变换

Markdown 实现文内链接跳转

Question 4 - datepicker date selector, disabling two date selectors (start and end dates)
![3D数学基础[十七] 平方反比定理](/img/59/bef931d96883288766fc94e38e0ace.png)
3D数学基础[十七] 平方反比定理

ZUCC_编译语言原理与编译_实验03 编译器入门

How to use the virtual clock of FPGA?
随机推荐
李白最经典的20首诗排行榜
VsCode主题推荐
ZUCC_编译语言原理与编译_实验08 语法分析 LR 分析
Swift 基础 闭包/Block的使用(源码)
[ACNOI2022]不是构造,胜似构造
Tool functions – get all files in the project folder
longhorn安装与使用
Opening chapter of online document technology - rich text editor
Live broadcast review | detailed explanation of koordinator architecture of cloud native hybrid system (complete ppt attached)
一文带你了解Windows操作系统安全,保护自己的电脑不受侵害
[introduction to point cloud dataset]
OpenCV get(propId) 常用的值
Understanding of the concept of "quality"
Saccadenet: use corner features to fine tune the two stage prediction frame | CVPR 2020
Getting started with ffmpeg
权限模型 DAC ACL RBAC ABAC
[acnoi2022] not a structure, more like a structure
PAT 1157:校庆
Question 1: the container that holds the most water
Detailed explanation of etcd backup and recovery principle and actual record of stepping on the pit