diff --git a/server/run.sh b/server/run.sh index 2327ee9..07c76bb 100755 --- a/server/run.sh +++ b/server/run.sh @@ -3,8 +3,16 @@ set -euo pipefail cd /home/dsyoon/workspace/meeting_ai/server +PORT="${PORT:-8018}" + +if lsof -ti tcp:"${PORT}" >/dev/null 2>&1; then + echo "Stopping existing server on port ${PORT}..." + lsof -ti tcp:"${PORT}" | xargs -r kill -9 + sleep 1 +fi + npm install npm run build -PORT="${PORT:-8018}" nohup npm run start > server.log 2>&1 & +PORT="${PORT}" nohup npm run start > server.log 2>&1 & echo "Server started (PID: $!). Logs: server.log" \ No newline at end of file