From 0d7dceede0ae557403d84c56105235d938eae8ae Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 10 Feb 2023 10:41:57 +0300 Subject: Add example utility script to run development server --- example-run-dev.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 example-run-dev.sh (limited to 'example-run-dev.sh') diff --git a/example-run-dev.sh b/example-run-dev.sh new file mode 100644 index 0000000..a0c5d61 --- /dev/null +++ b/example-run-dev.sh @@ -0,0 +1,31 @@ + +## An example script to run the development server. +## Copy to run-dev.sh and update the appropriate environment variables. + +export SQL_URI="${SQL_URI:+${SQL_URI}}" +export AUTH_DB="${AUTH_DB:+${AUTH_DB}}" +export FLASK_DEBUG=1 +export FLASK_APP="main.py" +export AUTHLIB_INSECURE_TRANSPORT=true + +CMD_ARGS=$@ +if [ ${#CMD_ARGS} -eq 0 ] +then + CMD_ARGS=("run" "--port=8080") +fi + +if [ -z "${SQL_URI}" ] +then + echo "ERROR: You need to specify the 'SQL_URI' environment variable"; + exit 1; +fi + +if [ -z "${AUTH_DB}" ] +then + echo "ERROR: You need to specify the 'AUTH_DB' environment variable"; + exit 1; +fi + + +# flask run --port=8080 +flask ${CMD_ARGS[@]} -- cgit v1.2.3