diff --git a/app/app.py b/app/app.py index f5e736e304075e21b5551fd0cdccb07c8b3f4f32..6059102aefac6976992410022bb2812c3260745f 100644 --- a/app/app.py +++ b/app/app.py @@ -7,6 +7,7 @@ from ipmd_weatherdata import WeatherData, weatherdata_utils app = Flask(__name__) +SITE_ROOT = os.path.dirname(os.path.realpath(__file__)) @app.route("/") def index(): @@ -27,7 +28,7 @@ def get_weather_data(): # Input check if longitude is None or latitude is None: return "BAD REQUEST: longitude (%s) and/or latitude (%s) is not set" % (longitude, latitude), 403 - wd_file = open("./data_files/2021_apelsvoll_redigert.json") + wd_file = open(SITE_ROOT + "/data_files/2021_apelsvoll_redigert.json") weather_data = WeatherData(**json.load(wd_file)) wd_file.close()