Commit fab59a81b9ddb08629206c562cf38b6d25e69a62

Authored by yibo
1 parent 30b2b832

fix: change default server port to 3010 to avoid conflict with other apps on remote server

server/config.js
@@ -5,7 +5,7 @@ const path = require('path'); @@ -5,7 +5,7 @@ const path = require('path');
5 require('dotenv').config({ path: path.join(__dirname, '../.env') }); 5 require('dotenv').config({ path: path.join(__dirname, '../.env') });
6 6
7 module.exports = { 7 module.exports = {
8 - port: process.env.PORT || 3000, 8 + port: process.env.PORT || 3010,
9 host: process.env.HOST || '0.0.0.0', 9 host: process.env.HOST || '0.0.0.0',
10 workspacesDir: process.env.WORKSPACES_DIR || './workspaces', 10 workspacesDir: process.env.WORKSPACES_DIR || './workspaces',
11 11
@@ -23,7 +23,7 @@ module.exports = { @@ -23,7 +23,7 @@ module.exports = {
23 cors: { 23 cors: {
24 origin: process.env.CORS_ORIGIN 24 origin: process.env.CORS_ORIGIN
25 ? process.env.CORS_ORIGIN.split(',').map(s => s.trim()) 25 ? process.env.CORS_ORIGIN.split(',').map(s => s.trim())
26 - : ['http://localhost:5173', 'http://localhost:3000'], 26 + : ['http://localhost:5173', 'http://localhost:3010'],
27 credentials: true, 27 credentials: true,
28 }, 28 },
29 29
start.sh
@@ -15,7 +15,7 @@ if [ ! -d "node_modules" ]; then @@ -15,7 +15,7 @@ if [ ! -d "node_modules" ]; then
15 fi 15 fi
16 16
17 # 检测并清理端口冲突 17 # 检测并清理端口冲突
18 -for PORT in 3000 5173; do 18 +for PORT in 3010 5173; do
19 PID=$(lsof -ti:$PORT 2>/dev/null || true) 19 PID=$(lsof -ti:$PORT 2>/dev/null || true)
20 if [ -n "$PID" ]; then 20 if [ -n "$PID" ]; then
21 echo "⚠️ 端口 $PORT 被占用 (PID: $PID),正在释放..." 21 echo "⚠️ 端口 $PORT 被占用 (PID: $PID),正在释放..."
@@ -26,8 +26,8 @@ for PORT in 3000 5173; do @@ -26,8 +26,8 @@ for PORT in 3000 5173; do
26 done 26 done
27 27
28 # 启动后端 Agent Chat Server 28 # 启动后端 Agent Chat Server
29 -echo "🔌 启动 Agent Server (端口 3000)..."  
30 -node server/agent-server.js & 29 +echo "🔌 启动 Agent Server (端口 3010)..."
  30 +PORT=3010 node server/agent-server.js &
31 SERVER_PID=$! 31 SERVER_PID=$!
32 32
33 # 等待后端启动 33 # 等待后端启动
@@ -47,7 +47,7 @@ echo "✅ LemonBoss 已启动!" @@ -47,7 +47,7 @@ echo "✅ LemonBoss 已启动!"
47 echo "" 47 echo ""
48 echo " 🌐 打开: http://localhost:5173" 48 echo " 🌐 打开: http://localhost:5173"
49 echo " 🧬 Innovator: http://localhost:5173/agent/innovator-001" 49 echo " 🧬 Innovator: http://localhost:5173/agent/innovator-001"
50 -echo " 🔌 API: http://localhost:3000/api/agent/list" 50 +echo " 🔌 API: http://localhost:3010/api/agent/list"
51 echo "" 51 echo ""
52 echo " 按 Ctrl+C 停止" 52 echo " 按 Ctrl+C 停止"
53 echo "═══════════════════════════════════" 53 echo "═══════════════════════════════════"
web/vite.config.js
@@ -14,11 +14,11 @@ export default defineConfig({ @@ -14,11 +14,11 @@ export default defineConfig({
14 host: '0.0.0.0', 14 host: '0.0.0.0',
15 proxy: { 15 proxy: {
16 '/api': { 16 '/api': {
17 - target: 'http://localhost:3000', 17 + target: 'http://localhost:3010',
18 changeOrigin: true 18 changeOrigin: true
19 }, 19 },
20 '/ws': { 20 '/ws': {
21 - target: 'ws://localhost:3000', 21 + target: 'ws://localhost:3010',
22 changeOrigin: true, 22 changeOrigin: true,
23 ws: true 23 ws: true
24 } 24 }