Skip to content

Commit 8d58558

Browse files
committed
更新部署教程
1 parent 8cf7839 commit 8d58558

File tree

1 file changed

+37
-5
lines changed

1 file changed

+37
-5
lines changed

docs/guide/release/server.md

+37-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,39 @@
11
# 服务端搭建
22

3-
> 写作中,目录结构:
4-
> ## MySQL安装
5-
> ## 创建数据库
6-
> ## 数据导入
7-
> ## 服务端部署
3+
## MySQL安装
4+
MySQL 安装相关请参考:[MySQL 数据库搭建](https://www.youbaobao.xyz/admin-docs/guide/exercise/prepare.html#mysql-%E6%95%B0%E6%8D%AE%E5%BA%93%E6%90%AD%E5%BB%BA)
5+
6+
## 创建数据库 & 数据导入
7+
1. 下载数据脚本([地址](https://www.youbaobao.xyz/mpvue-res/book.sql)
8+
2. 创建 book 数据库
9+
3. 通过 Navicat 等工具导入数据脚本
10+
11+
## 服务端部署
12+
1. 下载服务端源码([地址](https://git.imooc.com/coding-376/mpvue-imooc-node)
13+
2. 源码需要额外配置三个文件:
14+
- db/config.js 该文件为数据库文件,代码格式为:
15+
```js
16+
module.exports = {
17+
host: '127.0.0.1',
18+
user: 'root',
19+
password: '123456',
20+
database: 'book',
21+
}
22+
```
23+
24+
- alipay/appIdMap.js 该文件为微信小程序的 appId 和 secretKey,代码格式为:
25+
```js
26+
const appIdMap = {
27+
['your_wechat_app_id']: 'your_wechat_secret_key'
28+
}
29+
module.exports = appIdMap
30+
```
31+
32+
- https/** 需要创建 https 文件夹,里面存储通过阿里云注册获得的 https 证书
33+
```bash
34+
book_youbaobao_xyz.key
35+
book_youbaobao_xyz.pem
36+
```
37+
:::tip
38+
如果你的小程序需要发布到互联网,则必须包含 https 证书,因为小程序接口要求必须为 https 服务
39+
:::

0 commit comments

Comments
 (0)