Skip to content

Commit

Permalink
add version endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
bdpedigo authored and fcollman committed Apr 8, 2024
1 parent 3305c7f commit afc750c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion pychunkedgraph/app/segmentation/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ def handle_api_versions():
return jsonify(__api_versions__)


def handle_version():
return jsonify(__version__)


### GET ROOT -------------------------------------------------------------------


Expand Down Expand Up @@ -599,7 +603,7 @@ def handle_leaves(table_id, root_id):
user_id = str(g.auth_user.get("id", current_app.user_id))

stop_layer = int(request.args.get("stop_layer", 1))

bounding_box = _get_bounds_from_request(request)

cg = app_utils.get_cg(table_id)
Expand Down
10 changes: 8 additions & 2 deletions pychunkedgraph/app/segmentation/generic/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

from flask import Blueprint
from middle_auth_client import (
auth_requires_admin,
auth_required,
auth_requires_admin,
auth_requires_permission,
)

from pychunkedgraph.app import common as app_common
from pychunkedgraph.app.segmentation import common
from pychunkedgraph.app.app_utils import remap_public
from pychunkedgraph.app.segmentation import common
from pychunkedgraph.graph import exceptions as cg_exceptions

bp = Blueprint(
Expand Down Expand Up @@ -87,3 +87,9 @@ def handle_info(table_id):
@auth_required
def handle_api_versions():
return common.handle_api_versions()


@bp.route("/api/version", methods=["GET"])
@auth_required
def handle_version():
return common.handle_version()

0 comments on commit afc750c

Please sign in to comment.