运行和部署若依分离版前端

一、运行

一、用vscode打开

在这里插入图片描述

二、安装依赖

# 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题
npm install --registry=https://registry.npmmirror.com

# 启动服务
npm run dev

浏览器访问 http://localhost:80

二、部署

一、修改vue.config.js

生产环境路径改为 ./
在这里插入图片描述

二、打包

npm run build:prod

三、上传到服务器(省略docker安装教程)

可以看这篇文章 https://blog.csdn.net/lcc2001/article/details/127028242

四、修改nginx.conf

在这里插入图片描述

五、测试访问

在这里插入图片描述

六、运行和部署后端

看这篇文章 https://blog.csdn.net/lcc2001/article/details/134953451

猜你喜欢

转载自blog.csdn.net/lcc2001/article/details/134968022
今日推荐