Commit fab59a81b9ddb08629206c562cf38b6d25e69a62
1 parent
30b2b832
fix: change default server port to 3010 to avoid conflict with other apps on remote server
Showing
3 changed files
with
8 additions
and
8 deletions
server/config.js
| ... | ... | @@ -5,7 +5,7 @@ const path = require('path'); |
| 5 | 5 | require('dotenv').config({ path: path.join(__dirname, '../.env') }); |
| 6 | 6 | |
| 7 | 7 | module.exports = { |
| 8 | - port: process.env.PORT || 3000, | |
| 8 | + port: process.env.PORT || 3010, | |
| 9 | 9 | host: process.env.HOST || '0.0.0.0', |
| 10 | 10 | workspacesDir: process.env.WORKSPACES_DIR || './workspaces', |
| 11 | 11 | |
| ... | ... | @@ -23,7 +23,7 @@ module.exports = { |
| 23 | 23 | cors: { |
| 24 | 24 | origin: process.env.CORS_ORIGIN |
| 25 | 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 | 27 | credentials: true, |
| 28 | 28 | }, |
| 29 | 29 | ... | ... |
start.sh
| ... | ... | @@ -15,7 +15,7 @@ if [ ! -d "node_modules" ]; then |
| 15 | 15 | fi |
| 16 | 16 | |
| 17 | 17 | # 检测并清理端口冲突 |
| 18 | -for PORT in 3000 5173; do | |
| 18 | +for PORT in 3010 5173; do | |
| 19 | 19 | PID=$(lsof -ti:$PORT 2>/dev/null || true) |
| 20 | 20 | if [ -n "$PID" ]; then |
| 21 | 21 | echo "⚠️ 端口 $PORT 被占用 (PID: $PID),正在释放..." |
| ... | ... | @@ -26,8 +26,8 @@ for PORT in 3000 5173; do |
| 26 | 26 | done |
| 27 | 27 | |
| 28 | 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 | 31 | SERVER_PID=$! |
| 32 | 32 | |
| 33 | 33 | # 等待后端启动 |
| ... | ... | @@ -47,7 +47,7 @@ echo "✅ LemonBoss 已启动!" |
| 47 | 47 | echo "" |
| 48 | 48 | echo " 🌐 打开: http://localhost:5173" |
| 49 | 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 | 51 | echo "" |
| 52 | 52 | echo " 按 Ctrl+C 停止" |
| 53 | 53 | echo "═══════════════════════════════════" | ... | ... |
web/vite.config.js
| ... | ... | @@ -14,11 +14,11 @@ export default defineConfig({ |
| 14 | 14 | host: '0.0.0.0', |
| 15 | 15 | proxy: { |
| 16 | 16 | '/api': { |
| 17 | - target: 'http://localhost:3000', | |
| 17 | + target: 'http://localhost:3010', | |
| 18 | 18 | changeOrigin: true |
| 19 | 19 | }, |
| 20 | 20 | '/ws': { |
| 21 | - target: 'ws://localhost:3000', | |
| 21 | + target: 'ws://localhost:3010', | |
| 22 | 22 | changeOrigin: true, |
| 23 | 23 | ws: true |
| 24 | 24 | } | ... | ... |