Files
slogan/scripts/routes.sh
T

12 lines
325 B
Bash

#!/bin/bash
# 路由快照:输出 /api.json 的全部路径(排序去重)
# 用法:bash scripts/routes.sh > /tmp/routes-before.txt
set -e
BASE="${BASE:-http://localhost:3007}"
curl -s "$BASE/api.json" | python3 -c "
import json, sys
d = json.load(sys.stdin)
for p in sorted(d.get('paths', {}).keys()):
print(p)
"