This commit is contained in:
2025-03-07 17:45:17 +08:00
commit 936af0c4ec
114 changed files with 37662 additions and 0 deletions

26
backend/start-server.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
# 获取配置的端口默认为4000
PORT=$(grep "PORT=" .env | cut -d= -f2 || echo "4000")
echo "Service configured to use port $PORT"
# 查找并停止使用该端口的进程
PID=$(lsof -ti :$PORT)
if [ ! -z "$PID" ]; then
echo "Stopping process $PID using port $PORT..."
kill -9 $PID
sleep 1
fi
# 停止可能正在运行的服务器
echo "Stopping any running server..."
pkill -f "node dist/index.js" || true
pkill -f "tsx watch src/index.ts" || true
# 构建项目
echo "Building project..."
npm run build
# 启动服务器
echo "Starting server..."
npm start