Skip to content

Commit

Permalink
workaround for flask url_prefix issues is to not use it
Browse files Browse the repository at this point in the history
  • Loading branch information
gsfk committed Jun 11, 2024
1 parent b100bef commit 69c7221
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bento_beacon/network/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"]

Expand All @@ -34,7 +34,7 @@ def network_beacons():
}


@network.route("/query/<endpoint>", methods=["POST"])
@network.route("/network/query/<endpoint>", methods=["POST"])
def dumb_network_query(endpoint):
"""
Beacon network query in a single request and single response.
Expand Down Expand Up @@ -70,8 +70,8 @@ def dumb_network_query(endpoint):
return beacon_network_response(responses)


@network.route("/beacons/<beacon_id>")
@network.route("/beacons/<beacon_id>/<endpoint>", methods=["GET", "POST"])
@network.route("/network/beacons/<beacon_id>")
@network.route("/network/beacons/<beacon_id>/<endpoint>", methods=["GET", "POST"])
def query(beacon_id, endpoint="overview"):
beacon = current_app.config["NETWORK_BEACONS"].get(beacon_id)
if not beacon:
Expand Down

0 comments on commit 69c7221

Please sign in to comment.