Files
web/server/README.md

30 lines
755 B
Markdown
Raw Permalink 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.
# 多站点管理后台 - API 服务
基于 Gin 的后端 API 服务。
## MongoDB 连接SSH 穿透)
MongoDB 在远程服务器,需先建立 SSH 隧道:
```bash
ssh -p 2223 -L 27017:localhost:27017 yxd@www.yuxindazhineng.com
```
或双击运行 `scripts/start-ssh-tunnel.bat`
隧道建立后,`mongodb://localhost:27017` 会转发到远程 MongoDB。
## 运行
```bash
go mod tidy
go run main.go
```
默认端口 8080
## 推广视频转码promotion 目录)
上传到 `sites/{site_id}/promotion/**.mov` 后,服务会异步转 **MP4**(需本机安装 **ffmpeg**,与 Docker 镜像一致)。启动时也会扫描遗留 `.mov` 补转码。详见 `handlers/promotion_transcode.go`
关闭:`SKIP_PROMOTION_TRANSCODE=1`