当前位置:网站首页>uniapp开发,打包成H5部署到服务器
uniapp开发,打包成H5部署到服务器
2022-07-06 00:18:00 【马小跳的Coding进阶之路】
前端使用uniapp开发项目完成后,需要将页面打包,生成H5的静态文件,部署在服务器上。
这样通过服务器链接地址,直接可以在手机上点开来访问。
打包全步骤如下:
一、点击菜单栏“发行”,点击选择“网站-PC Web或手机H5”,
二、填写网站标题和网站域名/服务器的IP地址。
(这个地址是将项目打包之后存放静态文件的地址)
三、点击进入manifest.json的h5配置里,根据自己的情况配置一些信息。
一定要注意配置 “运行的基础路径”,如果出现空白页面或者静态文件404的情况,可能是因为这个路径没有配置好。
四、点击发行,控制台会自动编译。出现以下提示,说明编译成功:
五、点击上图中的红框部分,就能看到已经打包好的静态页面了。(直接把这个h5文件压缩一下,发给后端就可以了)
如需要自己上传到服务器上,可继续以下步骤。
六、先拿到服务器的地址信息,找一个工具,连接上该项目的服务器,进入到服务器的根目录底下。
我这里用的是ftp工具。在根目录底下新建一个aofan文件夹,然后将上图中的static文件夹和index.html复制进去即可。
OK,这个时候就已经部署成功了。
七、打开浏览器,输入服务器ip地址,访问一下index.html的内容即可。
注意点:这三个地方的路径名称一定要一致。
1:打包时候的配置的运行的基础路径
2:服务器根目录底下存放静态文件static和index.html
3:浏览器里面访问的路径
边栏推荐
- Detailed explanation of APP functions of door-to-door appointment service
- [designmode] composite mode
- [Chongqing Guangdong education] reference materials for Zhengzhou Vocational College of finance, taxation and finance to play around the E-era
- Problems encountered in the database
- STM32 configuration after chip replacement and possible errors
- [Chongqing Guangdong education] Chongqing Engineering Vocational and Technical College
- LeetCode 1189. Maximum number of "balloons"
- LeetCode 8. String conversion integer (ATOI)
- Single merchant v4.4 has the same original intention and strength!
- [designmode] adapter pattern
猜你喜欢
Choose to pay tribute to the spirit behind continuous struggle -- Dialogue will values [Issue 4]
MySql——CRUD
提升工作效率工具:SQL批量生成工具思想
多线程与高并发(8)—— 从CountDownLatch总结AQS共享锁(三周年打卡)
XML配置文件
权限问题:source .bash_profile permission denied
FFmpeg抓取RTSP图像进行图像分析
STM32 configuration after chip replacement and possible errors
Upgrade openssl-1.1.1p for openssl-1.0.2k
FFMPEG关键结构体——AVFrame
随机推荐
Atcoder beginer contest 258 [competition record]
Cloudcompare & PCL point cloud randomly adds noise
多线程与高并发(8)—— 从CountDownLatch总结AQS共享锁(三周年打卡)
LeetCode 斐波那契序列
Doppler effect (Doppler shift)
2022.7.5-----leetcode.729
什么叫做信息安全?包含哪些内容?与网络安全有什么区别?
Multithreading and high concurrency (8) -- summarize AQS shared lock from countdownlatch (punch in for the third anniversary)
Global and Chinese markets of universal milling machines 2022-2028: Research Report on technology, participants, trends, market size and share
【二叉搜索树】增删改查功能代码实现
MDK debug时设置数据实时更新
Yunna | what are the main operating processes of the fixed assets management system
OS i/o devices and device controllers
建立时间和保持时间的模型分析
shardingsphere源码解析
Priority queue (heap)
常用API类及异常体系
SQLServer连接数据库读取中文乱码问题解决
JS can really prohibit constant modification this time!
[QT] QT uses qjson to generate JSON files and save them