mirror of
https://github.com/benbusby/whoogle-search
synced 2024-10-30 09:20:50 +00:00
11fa44eec1
Executable renamed to "run" to avoid confusion with pip installed script Updated heroku deploy button to use the heroku-app branch, which by default enforces HTTPS Added instructions for enforcing HTTPS on various deployment options, with note about how this isn't a required task. Updated setup.py description to use improved app description
25 lines
548 B
Bash
Executable File
25 lines
548 B
Bash
Executable File
#!/bin/bash
|
|
# Usage:
|
|
# ./run # Runs the full web app
|
|
# ./run test # Runs the testing suite
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(builtin cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
|
|
|
|
# Set directory to serve static content from
|
|
SUBDIR="${1:-app}"
|
|
export APP_ROOT="$SCRIPT_DIR/$SUBDIR"
|
|
export STATIC_FOLDER="$APP_ROOT/static"
|
|
|
|
mkdir -p "$STATIC_FOLDER"
|
|
|
|
# Check for regular vs test run
|
|
if [[ "$SUBDIR" == "test" ]]; then
|
|
pytest -sv
|
|
else
|
|
python3 -um app \
|
|
--host "${ADDRESS:-0.0.0.0}" \
|
|
--port "${PORT:-"${EXPOSE_PORT:-5000}"}"
|
|
fi
|