diff options
author | Galen Guyer <galen@galenguyer.com> | 2020-10-31 11:58:32 -0400 |
---|---|---|
committer | Galen Guyer <galen@galenguyer.com> | 2020-10-31 11:59:58 -0400 |
commit | 1009968ea0ca43ef1b1bc421f7694f1f70707948 (patch) | |
tree | f40c80a45095782290fb1af52bd7e683d6a74710 /demo/__init__.py |
Initial commit
Diffstat (limited to 'demo/__init__.py')
-rw-r--r-- | demo/__init__.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/demo/__init__.py b/demo/__init__.py new file mode 100644 index 0000000..86af046 --- /dev/null +++ b/demo/__init__.py @@ -0,0 +1,20 @@ +""" A small flask Hello World """ + +import os +import subprocess + +from flask import Flask, jsonify + +APP = Flask(__name__) + +# Load file based configuration overrides if present +if os.path.exists(os.path.join(os.getcwd(), 'config.py')): + APP.config.from_pyfile(os.path.join(os.getcwd(), 'config.py')) +else: + APP.config.from_pyfile(os.path.join(os.getcwd(), 'config.env.py')) + +APP.secret_key = APP.config['SECRET_KEY'] + +@APP.route('/') +def _index(): + return jsonify(status=200, response="OK") |