From b6905c923528ba426e7503a7f0df297dc7d1a840 Mon Sep 17 00:00:00 2001 From: Aaron Kimbre Date: Mon, 28 Mar 2022 11:01:46 -0500 Subject: [PATCH] fix play key times used on view page Added early API listener enpionts --- app/__init__.py | 2 ++ app/api.py | 27 +++++++++++++++++++++++++++ app/templates/play_keys/view.html.j2 | 4 ++-- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 app/api.py diff --git a/app/__init__.py b/app/__init__.py index 85dd958..4c3a915 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -154,6 +154,8 @@ def register_blueprints(app): app.register_blueprint(luclient_blueprint, url_prefix='/luclient') from .reports import reports_blueprint app.register_blueprint(reports_blueprint, url_prefix='/reports') + from .api import api_blueprint + app.register_blueprint(api_blueprint, url_prefix='/api') def register_logging(app): diff --git a/app/api.py b/app/api.py new file mode 100644 index 0000000..d1e8718 --- /dev/null +++ b/app/api.py @@ -0,0 +1,27 @@ +from flask import Blueprint, current_app, request + +api_blueprint = Blueprint('api', __name__) + + +@api_blueprint.route('/web', methods=['GET', 'POST']) +def web(): + current_app.logger.info(f"API::WEB [DATA] {request.data}") + return + + +@api_blueprint.route('/game', methods=['GET', 'POST']) +def game(): + current_app.logger.info(f"API::GAME [DATA] {request.data}") + return + + +@api_blueprint.route('/game_content', methods=['GET', 'POST']) +def game_content(): + current_app.logger.info(f"API::GAME CONTENT [DATA] {request.data}") + return + + +@api_blueprint.route('/metrics_data_service', methods=['GET', 'POST']) +def metrics_data_service(): + current_app.logger.info(f"API::METRICS DATA SERVICE [DATA] {request.data}") + return diff --git a/app/templates/play_keys/view.html.j2 b/app/templates/play_keys/view.html.j2 index 00332bc..ef735b6 100644 --- a/app/templates/play_keys/view.html.j2 +++ b/app/templates/play_keys/view.html.j2 @@ -28,11 +28,11 @@
- Uses Left: + Times Used:

- {{ key.key_uses}} + {{ key.times_used}}