Files
goalfylearning-admin/start_with_cors.sh

37 lines
813 B
Bash
Raw 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.

#!/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