aboutsummaryrefslogtreecommitdiff
path: root/example-run-dev.sh
blob: a0c5d6106703ed4ec03765c4d943fcdb47febeff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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[@]}