Skip to content

Commit

Permalink
🚸 perf: 合并 jsonp/api env
Browse files Browse the repository at this point in the history
  • Loading branch information
soxft committed Dec 3, 2024
1 parent c15618f commit 2d84196
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
3 changes: 1 addition & 2 deletions docker-compose.build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ services:
WEB_CORS: "*" # 跨域访问
BSZ_EXPIRE: 0 # 统计数据过期时间 单位秒, 请输入整数 (无任何访问, 超过这个时间后, 统计数据将被清空, 0为不过期)
BSZ_SECRET: "bsz" # 签名密钥 // 请设置为任意长度的随机值
API_SERVER: http://127.0.0.1:8080/api # 填写你的 API 地址
API_JSONP_SERVER: http://127.0.0.1:8080/jsonp # 填写你的 API 地址
API_SERVER: http://127.0.0.1:8080 # 填写你的 API 地址
REDIS_ADDRESS: redis:6379 # redis 地址
BSZ_PATHSTYLE: true
BSZ_ENCRYPT: MD516
3 changes: 1 addition & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ services:
WEB_CORS: "*" # 跨域访问
BSZ_EXPIRE: 0 # 统计数据过期时间 单位秒, 请输入整数 (无任何访问, 超过这个时间后, 统计数据将被清空, 0为不过期)
BSZ_SECRET: "bsz" # 签名密钥 // 请设置为任意长度的随机值
API_SERVER: http://127.0.0.1:8080/api # 填写你的 API 地址
API_JSONP_SERVER: http://127.0.0.1:8080/jsonp # 填写你的 API 地址
API_SERVER: http://127.0.0.1:8080 # 填写你的 API 地址
REDIS_ADDRESS: redis:6379 # redis 地址
BSZ_PATHSTYLE: true
BSZ_ENCRYPT: MD516
9 changes: 1 addition & 8 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,11 @@ cd /app || exit
if [ ! -f "/app/install.lock" ];then
# busuanzi js API address
if [ -n "$API_SERVER" ];then
sed -i "s|http://127.0.0.1:8080/api|$API_SERVER|g" dist/*.js
sed -i "s|http://127.0.0.1:8080|$API_SERVER|g" dist/*.js

echo "Replace API_SERVER to $API_SERVER"
fi

# busuanzi js API address
if [ -n "$API_JSONP_SERVER" ];then
sed -i "s|http://127.0.0.1:8080/jsonp|$API_JSONP_SERVER|g" dist/busuanzi.jsonp.js

echo "Replace API_JSONP_SERVER to $API_JSONP_SERVER"
fi

touch /app/install.lock
fi

Expand Down

0 comments on commit 2d84196

Please sign in to comment.