当前位置:网站首页>How to use wechat cloud hosting or cloud functions for cloud development of unapp development applet
How to use wechat cloud hosting or cloud functions for cloud development of unapp development applet
2022-07-07 06:23:00 【Aasee.】
One . Apply for wechat cloud hosting
Needless to say, it's necessary , Official address Here . Just go in and apply .
But the premise is that you have to be able to create docker file, Learn to master some basic docker knowledge , It will make it easier for you to create an environment . After the environment is created, the following operations can be carried out .
Two . So let's create one cloudfunctions Folder
like this , Just put an empty file in it js ah css Anything will do , In this way, subsequent copies can be made .
Configuration path
Then we can go uniapp Inside manifest.json
File configuration cloudfunctions
The location of the folder , Take me as an example
"cloudfunctionRoot": "cloudfunctions/"
because uniapp This file will not be compiled to mp-weixin platform , So here we copy it . Here I also refer to The code for this article . Download a plug-in first .
npm install -save [email protected]
After the download is complete, go to vue.config.js
The file is configured as follows
const path = require('path')
const CopyWebpackPlugin = require('copy-webpack-plugin')
module.exports = {
configureWebpack: {
plugins: [
new CopyWebpackPlugin([
{
from: path.join(__dirname, 'cloudfunctions'),
to: path.join(__dirname, 'try-music/dist', process.env.NODE_ENV === 'development' ? 'dev' : 'build', process.env.UNI_PLATFORM, 'cloudfunctions')
}
])
]
}
}
find uniapp The files created in are compiled into packages in the corresponding environment .
You should know the path .
Just write down your own path .
3、 ... and . initialization , Then you can call .
One . initialization
stay App.vue
In the document onLounch Add
This is directly in Official wechat documents You can also see .
Two . Calling method
Here you can go directly to uniapp Wechat cloud hosting service is used in , Of course, if you really feel troublesome, you can also use the opening directly https Server for use , You can also use uniapp Officially recommended unicloud service .
边栏推荐
- A freshman's summary of an ordinary student [I don't know whether we are stupid or crazy, but I know to run forward all the way]
- 屏幕程序用串口无法调试情况
- A very good JVM interview question article (74 questions and answers)
- POI导出Excel:设置字体、颜色、行高自适应、列宽自适应、锁住单元格、合并单元格...
- Redis(二)—Redis通用命令
- Party A's requirements for those who have lost 800 yuan
- 博士申请 | 上海交通大学自然科学研究院洪亮教授招收深度学习方向博士生
- go-microservice-simple(2) go-Probuffer
- ceres-solver和g2o性能比较
- 雷特智能家居龙海祁:从专业调光到全宅智能,20年专注成就专业
猜你喜欢
Check point: the core element for enterprises to deploy zero trust network (ztna)
测试开发基础,教你做一个完整功能的Web平台之环境准备
一段程序让你明白什么静态内部类,局部内部类,匿名内部类
JVM命令之 jstat:查看JVM统计信息
【GNN】图解GNN: A gentle introduction(含视频)
JMeter's own functions are not enough? Why don't you develop one yourself
直击2022ECDC萤石云开发者大会:携手千百行业加速智能升级
DC-7靶机
3531. Huffman tree
蚂蚁庄园安全头盔 7.8蚂蚁庄园答案
随机推荐
一段程序让你明白什么静态内部类,局部内部类,匿名内部类
JVM监控及诊断工具-命令行篇
SubGHz, LoRaWAN, NB-IoT, 物联网
Go language learning notes - Gorm use - native SQL, named parameters, rows, tosql | web framework gin (IX)
蚂蚁庄园安全头盔 7.8蚂蚁庄园答案
Career experience feedback to novice programmers
MySQL(十)
Markdown 并排显示图片
Redisl garbled code and expiration time configuration
JVM monitoring and diagnostic tools - command line
10W word segmentation searches per second, the product manager raised another demand!!! (Collection)
谷歌 Chrome 浏览器发布 103.0.5060.114 补丁修复 0-day 漏洞
rt-thread 中对 hardfault 的处理
基于FPGA的VGA协议实现
Rk3399 platform development series explanation (interruption) 13.10, workqueue work queue
Jstat of JVM command: View JVM statistics
3531. 哈夫曼树
Software testing knowledge reserve: how much do you know about the basic knowledge of "login security"?
uniapp开发小程序如何使用微信云托管或云函数进行云开发
FlexRay通信协议概述