diff --git a/.gitignore b/.gitignore index 7bbc71c..44a356f 100644 --- a/.gitignore +++ b/.gitignore @@ -99,3 +99,6 @@ ENV/ # mypy .mypy_cache/ + +#vscode +.vscode/ diff --git a/app.json b/app.json new file mode 100644 index 0000000..e2c2203 --- /dev/null +++ b/app.json @@ -0,0 +1,21 @@ +{ + "name": "bi-redirector", + "description": "Redirect queries from PowerBI", + "scripts": { + }, + "env": { + "PORT": { + "required": true + } + }, + "formation": { + }, + "addons": [ + + ], + "buildpacks": [ + { + "url": "heroku/python" + } + ] +} \ No newline at end of file diff --git a/redirector.py b/redirector.py index 4a77e0f..3a08a1a 100644 --- a/redirector.py +++ b/redirector.py @@ -1,9 +1,8 @@ """ Redirector """ -import os - from flask import Flask, request, redirect +from settings import PORT APP = Flask(__name__) @@ -20,5 +19,4 @@ def redirect_to_box(): return redirect(new_url) if __name__ == '__main__': - PORT = int(os.environ.get('PORT', 5000)) APP.run(host='0.0.0.0', port=PORT, debug=True) diff --git a/requirements.txt b/requirements.txt index 46d9636..81d6ba7 100644 Binary files a/requirements.txt and b/requirements.txt differ diff --git a/settings.py b/settings.py new file mode 100644 index 0000000..bb5ccdc --- /dev/null +++ b/settings.py @@ -0,0 +1,11 @@ +# settings.py +from os import environ +from dotenv import load_dotenv, find_dotenv + +load_dotenv(find_dotenv()) + +DOWNLOAD_PATH = environ.get('DOWNLOAD_PATH') +REPORT_SERVER = environ.get('REPORT_SERVER') +REPORT_USERNAME = environ.get('REPORT_USERNAME') +REPORT_PASSWORD = environ.get('REPORT_PASSWORD') +PORT = int(environ.get('PORT'))