Skip to content

Instantly share code, notes, and snippets.

@ryanlelek
Created December 11, 2013 03:59
Show Gist options
  • Save ryanlelek/7904889 to your computer and use it in GitHub Desktop.
Save ryanlelek/7904889 to your computer and use it in GitHub Desktop.
# First, run your node script with nohup
# (keep the "&" at the end, it puts the process in teh background)
nohup node server/index.js --port 8443 &
# Now we capture the process ID so we know what to kill later
export SERVER_PID=$!;
echo $SERVER_PID;
# Sleep 5 Seconds to allow the server script time to startup
# Adjust to your needs
sleep 5;
# Run the tests
npm test;
# Kill the Server
kill $SERVER_PID;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment