-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-api.sh
More file actions
executable file
·39 lines (34 loc) · 1.16 KB
/
Copy pathstart-api.sh
File metadata and controls
executable file
·39 lines (34 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
echo "🚀 Starting Agent Network State API Server..."
echo "=============================================="
# Install dependencies if node_modules doesn't exist
if [ ! -d "api/node_modules" ]; then
echo "📦 Installing dependencies..."
cd api && npm install
cd ..
fi
# Start the API server in background
echo "🌐 Starting API server on port 8081..."
cd api && npm start &
API_PID=$!
# Wait a moment for server to start
sleep 3
# Test if server is running
if curl -s http://localhost:8081/health > /dev/null; then
echo "✅ API Server running successfully!"
echo ""
echo "📋 Available endpoints:"
echo " 🏠 Health Check: http://localhost:8081/health"
echo " 📖 API Documentation: http://localhost:8081/api/docs"
echo " 🤖 Register Agent: POST http://localhost:8081/api/agents/register"
echo " 📊 List Agents: GET http://localhost:8081/api/agents"
echo ""
echo "🎮 Frontend Demo: http://localhost:8080"
echo "📡 Agent API: http://localhost:8081/api"
echo ""
echo "🛑 To stop: kill $API_PID"
else
echo "❌ Failed to start API server"
kill $API_PID 2>/dev/null
exit 1
fi