#!/usr/bin/env bash
cd "$(dirname "$0")/.."
[ $PORT ]     || PORT=3001
[ $RACK_ENV ] || RACK_ENV=development

cmd="ruby -I lib -S bundle exec ruby -I lib -S puma -p $PORT"
if [ "$SSL" = true ] ; then
  cmd="$cmd -b ssl://127.0.0.1:$PORT?key=server.key&cert=server.crt"
fi
# [[ $RACK_ENV == "development" ]] && exec rerun "$cmd" -p '{lib,public}/**/*'
exec $cmd
