diff --git a/server/config.js b/server/config.js index b4ad1f5..180713e 100644 --- a/server/config.js +++ b/server/config.js @@ -5,7 +5,7 @@ const path = require('path'); require('dotenv').config({ path: path.join(__dirname, '../.env') }); module.exports = { - port: process.env.PORT || 3000, + port: process.env.PORT || 3010, host: process.env.HOST || '0.0.0.0', workspacesDir: process.env.WORKSPACES_DIR || './workspaces', @@ -23,7 +23,7 @@ module.exports = { cors: { origin: process.env.CORS_ORIGIN ? process.env.CORS_ORIGIN.split(',').map(s => s.trim()) - : ['http://localhost:5173', 'http://localhost:3000'], + : ['http://localhost:5173', 'http://localhost:3010'], credentials: true, }, diff --git a/start.sh b/start.sh index 423a7a0..c602800 100755 --- a/start.sh +++ b/start.sh @@ -15,7 +15,7 @@ if [ ! -d "node_modules" ]; then fi # 检测并清理端口冲突 -for PORT in 3000 5173; do +for PORT in 3010 5173; do PID=$(lsof -ti:$PORT 2>/dev/null || true) if [ -n "$PID" ]; then echo "⚠️ 端口 $PORT 被占用 (PID: $PID),正在释放..." @@ -26,8 +26,8 @@ for PORT in 3000 5173; do done # 启动后端 Agent Chat Server -echo "🔌 启动 Agent Server (端口 3000)..." -node server/agent-server.js & +echo "🔌 启动 Agent Server (端口 3010)..." +PORT=3010 node server/agent-server.js & SERVER_PID=$! # 等待后端启动 @@ -47,7 +47,7 @@ echo "✅ LemonBoss 已启动!" echo "" echo " 🌐 打开: http://localhost:5173" echo " 🧬 Innovator: http://localhost:5173/agent/innovator-001" -echo " 🔌 API: http://localhost:3000/api/agent/list" +echo " 🔌 API: http://localhost:3010/api/agent/list" echo "" echo " 按 Ctrl+C 停止" echo "═══════════════════════════════════" diff --git a/web/vite.config.js b/web/vite.config.js index f3cbe47..63dc0ea 100644 --- a/web/vite.config.js +++ b/web/vite.config.js @@ -14,11 +14,11 @@ export default defineConfig({ host: '0.0.0.0', proxy: { '/api': { - target: 'http://localhost:3000', + target: 'http://localhost:3010', changeOrigin: true }, '/ws': { - target: 'ws://localhost:3000', + target: 'ws://localhost:3010', changeOrigin: true, ws: true }