From 9fb3d28cdc84317cf2d697c8806c9d307013e13c Mon Sep 17 00:00:00 2001 From: W1CDN Date: Wed, 12 Jul 2023 14:48:26 -0500 Subject: [PATCH] API calls should use relative paths. --- api_app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api_app.py b/api_app.py index d0b0a2c..6e45558 100644 --- a/api_app.py +++ b/api_app.py @@ -118,13 +118,13 @@ def index(): # Get list of recent packets using API # TODO use relative path - response = json.loads(requests.get("https://digi.w1cdn.net/aprs_api/packets").text)['data'] + response = json.loads(requests.get(url_for("packets", _external=True)).text)['data'] # Play with function to create station list #stations = select_all_stations(get_db_connection()) #print(url_for("static", filename="test.txt", _external=True)) # this should work: stations = json.loads(requests.get(url_for("stations", _external=True)).text)['data'] - stations = json.loads(requests.get("https://digi.w1cdn.net/aprs_api/stations").text)['data'] + stations = json.loads(requests.get(url_for("stations", _external=True)).text)['data'] # Convert unix time to datetime on the fly because I'm lazy right now for station in stations: if station['last_heard_unix'] != None: