From 69c72214c965db27259c80faac1b396a5e6b72c9 Mon Sep 17 00:00:00 2001 From: Gordon Krieger Date: Tue, 11 Jun 2024 19:15:53 +0000 Subject: [PATCH] workaround for flask url_prefix issues is to not use it --- bento_beacon/network/network.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bento_beacon/network/network.py b/bento_beacon/network/network.py index ef2c91c0..3c400fb5 100644 --- a/bento_beacon/network/network.py +++ b/bento_beacon/network/network.py @@ -6,7 +6,7 @@ from .utils import beacon_network_response, network_beacon_get, network_beacon_post from .network_config import VALID_ENDPOINTS, KATSU_CONFIG_UNION, KATSU_CONFIG_INTERSECTION -network = Blueprint("network", __name__, url_prefix="/network") +network = Blueprint("network", __name__) # TODOs: @@ -18,8 +18,8 @@ # handle GET args -@network.route("/") -@network.route("/beacons") +@network.route("/network") +@network.route("/network/beacons") def network_beacons(): beacons = current_app.config["NETWORK_BEACONS"] @@ -34,7 +34,7 @@ def network_beacons(): } -@network.route("/query/", methods=["POST"]) +@network.route("/network/query/", methods=["POST"]) def dumb_network_query(endpoint): """ Beacon network query in a single request and single response. @@ -70,8 +70,8 @@ def dumb_network_query(endpoint): return beacon_network_response(responses) -@network.route("/beacons/") -@network.route("/beacons//", methods=["GET", "POST"]) +@network.route("/network/beacons/") +@network.route("/network/beacons//", methods=["GET", "POST"]) def query(beacon_id, endpoint="overview"): beacon = current_app.config["NETWORK_BEACONS"].get(beacon_id) if not beacon: