37 lines
813 B
Bash
37 lines
813 B
Bash
#!/bin/bash
|
||
|
||
# GoalfyMax Admin 启动脚本(带CORS支持)
|
||
|
||
echo "启动 GoalfyMax Admin 服务..."
|
||
|
||
# 检查Go环境
|
||
if ! command -v go &> /dev/null; then
|
||
echo "错误: 未找到Go环境,请先安装Go 1.25+"
|
||
exit 1
|
||
fi
|
||
|
||
# 检查配置文件
|
||
if [ ! -f "etc/config.yaml" ]; then
|
||
echo "错误: 配置文件 etc/config.yaml 不存在"
|
||
exit 1
|
||
fi
|
||
|
||
# 下载依赖
|
||
echo "下载依赖..."
|
||
go mod download
|
||
|
||
# 构建项目
|
||
echo "构建项目..."
|
||
go build -o bin/goalfymax-admin cmd/server/main.go
|
||
|
||
# 启动服务
|
||
echo "启动服务(支持CORS)..."
|
||
echo "服务地址: http://localhost:8084"
|
||
echo "健康检查: http://localhost:8084/health"
|
||
echo "配额历史: http://localhost:8084/api/quotas/history"
|
||
echo ""
|
||
echo "按 Ctrl+C 停止服务"
|
||
echo ""
|
||
|
||
./bin/goalfymax-admin -config etc/config.yaml
|