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}}