update at 2026-02-10 13:47:16
This commit is contained in:
@@ -87,7 +87,7 @@ location /api/ {
|
||||
sudo nginx -t && sudo systemctl reload nginx
|
||||
```
|
||||
|
||||
## 4. systemd(可选)
|
||||
## 4. systemd(Linux,可选)
|
||||
|
||||
仓库内提供示例:`apiserver/font2svg-api.service.example`,可复制到:
|
||||
|
||||
@@ -98,7 +98,38 @@ sudo systemctl enable --now font2svg-api
|
||||
sudo systemctl status font2svg-api
|
||||
```
|
||||
|
||||
## 5. 约束
|
||||
## 5. launchd(macOS,可选)
|
||||
|
||||
仓库内提供示例:`apiserver/font2svg-api.launchd.plist.example`。
|
||||
|
||||
1. 复制并按本机路径修改(重点改 Python 路径和项目路径):
|
||||
|
||||
```bash
|
||||
cp apiserver/font2svg-api.launchd.plist.example ~/Library/LaunchAgents/cn.biboer.font2svg-api.plist
|
||||
```
|
||||
|
||||
2. 加载并启动:
|
||||
|
||||
```bash
|
||||
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/cn.biboer.font2svg-api.plist
|
||||
launchctl enable gui/$(id -u)/cn.biboer.font2svg-api
|
||||
launchctl kickstart -k gui/$(id -u)/cn.biboer.font2svg-api
|
||||
```
|
||||
|
||||
3. 查看状态与日志:
|
||||
|
||||
```bash
|
||||
launchctl print gui/$(id -u)/cn.biboer.font2svg-api
|
||||
tail -f /tmp/font2svg-api.log
|
||||
```
|
||||
|
||||
4. 停止并卸载:
|
||||
|
||||
```bash
|
||||
launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/cn.biboer.font2svg-api.plist
|
||||
```
|
||||
|
||||
## 6. 约束
|
||||
|
||||
- 字体解析完全基于字体清单(默认 `miniprogram/assets/fonts.json`),字体文件统一从 `<static-root>/fonts/` 读取,`fontId` 必须存在。
|
||||
- 服务端启用 CORS,允许小程序访问。
|
||||
|
||||
Reference in New Issue
Block a user