Files
claude-hub/start-api.sh
Jonathan Flatt fc567071dd Initial commit
2025-05-20 17:01:59 +00:00

16 lines
457 B
Bash
Executable File

#!/bin/bash
# Get port from environment or default to 3003
DEFAULT_PORT=${PORT:-3003}
# Kill any processes using the port
echo "Checking for existing processes on port $DEFAULT_PORT..."
pid=$(lsof -ti:$DEFAULT_PORT)
if [ ! -z "$pid" ]; then
echo "Found process $pid using port $DEFAULT_PORT, killing it..."
kill -9 $pid
fi
# Start the server with the specified port
echo "Starting server on port $DEFAULT_PORT..."
PORT=$DEFAULT_PORT node src/index.js