folderPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
defaultConfigPath="$folderPath/local_config.json"
# configPath=${1:-$defaultConfigPath}
configPath=$defaultConfigPath
echo spinning up test server in folder $folderPath
(
  cd $folderPath;
  git pull origin master
# rm -rf node_modules;
  npm install --production
)

forever stop $folderPath/spinUpServer.js
forever cleanlogs
forever --spinSleepTime 1000 start $folderPath/spinUpServer.js --config $configPath
