35 lines
1.1 KiB
Markdown
35 lines
1.1 KiB
Markdown
|
|
# 慧添翼音乐教室前端
|
|||
|
|
|
|||
|
|
[](https://github.com/alchemy-studio/htymusic/actions)
|
|||
|
|
[](https://github.com/alchemy-studio/htymusic/actions)
|
|||
|
|
|
|||
|
|
|
|||
|
|
# Run in local
|
|||
|
|
|
|||
|
|
|
|||
|
|
相关设置:
|
|||
|
|
1. 在hosts中添加 `127.0.0.1 local.moicen.com`
|
|||
|
|
2. nginx路径配置添加:
|
|||
|
|
|
|||
|
|
```nginx
|
|||
|
|
location /mini/api/v1/ws/ {
|
|||
|
|
proxy_pass http://127.0.0.1:3001/api/v1/ws/;
|
|||
|
|
proxy_set_header Host "music-room.moicen.com";
|
|||
|
|
}
|
|||
|
|
location /mini/api/v1/uc/ {
|
|||
|
|
proxy_pass http://127.0.0.1:3000/api/v1/uc/;
|
|||
|
|
proxy_set_header Host "music-room.moicen.com";
|
|||
|
|
}
|
|||
|
|
location /mini/api/v1/ts/ {
|
|||
|
|
proxy_pass http://127.0.0.1:8080/api/v1/ts/;
|
|||
|
|
proxy_set_header Host "music-room.moicen.com";
|
|||
|
|
}
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
|
|||
|
|
启动命令:`mode=local npm start`,`mode=test vite`,`mode=prod yarn vite`。如不指定`mode`参数,默认为`local`
|
|||
|
|
`mode`参数为:
|
|||
|
|
- `local`: 本地启动,指向本地的3000和30001端口
|
|||
|
|
- `test`: 测试环境,指向`test-music-room.moicen.com`
|
|||
|
|
- `prod`: 生产环境,指向`music-room.alchemy-studio.cn`
|