Files
BH-Bookstore-2023/docs/user/系统安装手册.md
2023-12-15 13:25:14 +00:00

31 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 部署
## 依赖
- `g++``CMake`注意要支持C++17
- `Node.js``npm`
## 下载与构建
1. 下载或克隆本仓库,并进入仓库根目录
2. 运行以下指令:
```
mkdir build
cd build
cmake -B . -S ..
cmake --build .
cd ../frontend/Web
npm install
```
## 安装
直接把**整个项目文件夹**移动到你想移动到的位置
# 运维
## 打开与关闭
启动方式:用`node`执行`frontend/Web/index.js`,务必在后面带上数据库存放位置,它应当是一个目录,并且必须以`/`结尾。执行该命令后会一直等到服务器停止运行才退出。服务器监听3000端口。示例`node index.js /bookdata/`
关闭方式打开WebUI以超级管理员身份登录并在浏览器控制台中输入`await ShutDownWholeSystem();`,没有任何输出则表明关闭成功。
## 注意事项与TIP
- 后端带有缓存,务必避免强制中止
- 执行启动命令后,会一直等到服务器停止运行才退出,如果使用`systemd`管理,类型是`simple`而**不是**`forking`
- 服务器启动后会一直向标注输出打印Log可以把它重定向并收集起来。
- 务必保证服务器运行在域名根目录下