feat: add postgres storage and remote sync

This commit is contained in:
2025-11-07 16:59:28 +08:00
parent c4be264ea5
commit d0ba2b188b
32 changed files with 1101 additions and 1170 deletions

View File

@@ -28,19 +28,19 @@ sleep 3
# 验证启动
if ps -p $SERVER_PID > /dev/null; then
echo "✅ 服务器已启动 (PID: $SERVER_PID)"
echo "📡 SSE 端点: http://127.0.0.1:8091/sse"
echo "📡 SSE 端点: http://127.0.0.1:8094/sse"
echo "📋 日志文件: /tmp/funstat_sse.log"
# 测试端点
echo ""
echo "🧪 测试端点..."
if curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:8091/sse | grep -q "200"; then
if curl -s -o /dev/null -w "%{http_code}" -H 'Accept: text/event-stream' http://127.0.0.1:8094/sse | grep -Eq "200|204|206"; then
echo "✅ GET /sse 测试通过"
else
echo "❌ GET /sse 测试失败"
fi
if curl -s -o /dev/null -w "%{http_code}" -X POST http://127.0.0.1:8091/sse -H 'Content-Type: application/json' -d '{}' | grep -q "200"; then
if curl -s -o /dev/null -w "%{http_code}" -X POST http://127.0.0.1:8094/sse -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{}' | grep -q "200"; then
echo "✅ POST /sse 测试通过"
else
echo "❌ POST /sse 测试失败"
@@ -49,7 +49,7 @@ if ps -p $SERVER_PID > /dev/null; then
echo ""
echo "📊 服务器状态:"
echo " 进程ID: $SERVER_PID"
echo " 监听地址: http://127.0.0.1:8091"
echo " 监听地址: http://127.0.0.1:8094"
echo " 日志: tail -f /tmp/funstat_sse.log"
else
echo "❌ 服务器启动失败!"