当前位置:网站首页>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 .
边栏推荐
- vim映射大K
- Qt多线程的多种方法之一 QThread
- Shared memory for interprocess communication
- Laravel uses Tencent cloud cos5 full tutorial
- string(讲解)
- Developers don't miss it! Oar hacker marathon phase III chain oar track registration opens
- MySQL(十)
- SubGHz, LoRaWAN, NB-IoT, 物联网
- Swagger3 configuration
- 【GNN】图解GNN: A gentle introduction(含视频)
猜你喜欢
Markdown 并排显示图片
直击2022ECDC萤石云开发者大会:携手千百行业加速智能升级
Find duplicate email addresses
Implementation of VGA protocol based on FPGA
dolphinscheduler3.x本地启动
You don't know the complete collection of recruitment slang of Internet companies
测试开发基础,教你做一个完整功能的Web平台之环境准备
Financial risk control practice - decision tree rule mining template
@Detailed differences between pathvariable and @requestparam
力扣62 不同路径(从矩阵左上到右下的所有路径数量) (动态规划)
随机推荐
laravel 使用腾讯云 COS5全教程
软件测试知识储备:关于「登录安全」的基础知识,你了解多少?
Calculation model FPS
Career experience feedback to novice programmers
外设驱动库开发笔记43:GPIO模拟SPI驱动
Jstat of JVM command: View JVM statistics
New Year Fireworks code plus copy, are you sure you don't want to have a look
Peripheral driver library development notes 43: GPIO simulation SPI driver
软件测试的几个关键步骤,你需要知道
生活中的开销,怎么记账合适
POI导出Excel:设置字体、颜色、行高自适应、列宽自适应、锁住单元格、合并单元格...
When we talk about immutable infrastructure, what are we talking about
直击2022ECDC萤石云开发者大会:携手千百行业加速智能升级
How to set up in touch designer 2022 to solve the problem that leap motion is not recognized?
Rk3399 platform development series explanation (interruption) 13.10, workqueue work queue
港科大&MSRA新研究:关于图像到图像转换,Fine-tuning is all you need
win系统下安装redis以及windows扩展方法
MySQL(十)
基于ADAU1452的DSP及DAC音频失真分析
蚂蚁庄园安全头盔 7.8蚂蚁庄园答案