From b3d9e669169bdb8fc2f5f9ae7ef8493c9b2c1b6d Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Sun, 25 Feb 2024 21:46:57 +1100 Subject: [PATCH] feat: Add vote proofs --- main.py | 7 ++++++- templates/index.html | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index cae3c0f..4e60c37 100644 --- a/main.py +++ b/main.py @@ -174,7 +174,12 @@ def send_discord_message(data): if DISCORD_WEBHOOK is not None: requests.post(DISCORD_WEBHOOK, data=json.dumps(message), headers={'Content-Type': 'application/json'}) - +@app.route('/votes') +def download(): + resp = make_response(send_from_directory('data', 'votes.json')) + # Set as json + resp.headers['Content-Type'] = 'application/json' + return resp # 404 catch all @app.errorhandler(404) diff --git a/templates/index.html b/templates/index.html index 3d5ddc9..f45a582 100644 --- a/templates/index.html +++ b/templates/index.html @@ -55,7 +55,7 @@ {{votes|safe}}
-
+