whoogle-search/whoogle-search
Whitney B db7cf7381b
Fixed missing host parameter bug. (#38)
Co-authored-by: Whitney Burian <whitneyburian@gmail.com>
2020-05-12 23:32:15 -06:00

26 lines
568 B
Bash
Executable File

#!/bin/bash
# Usage:
# ./whoogle-search # Runs the full web app
# ./whoogle-search test # Runs the testing suite
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"
# Set default port if unavailable
if [[ -z "${PORT}" ]]; then
PORT=5000
fi
# Set directory to serve static content from
[[ ! -z $1 ]] && SUBDIR="$1" || SUBDIR="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 0.0.0.0 --port $PORT
fi