From 34314fe90c4fbd12c4b8b1519efa609243cd897b Mon Sep 17 00:00:00 2001 From: dechert Date: Fri, 18 Jun 2021 15:50:40 +0200 Subject: [PATCH] button to redirect to marp server --- .gitignore | 1 + rest_server.py | 11 +++++++++++ templates/return_result.html | 1 + 3 files changed, 13 insertions(+) diff --git a/.gitignore b/.gitignore index 0a6e27e..9dac8e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .idea csvmarp +csvconvertervenv # ---> Python # Byte-compiled / optimized / DLL files diff --git a/rest_server.py b/rest_server.py index 4e018c4..25601c9 100644 --- a/rest_server.py +++ b/rest_server.py @@ -118,6 +118,17 @@ def valid_csv(filename): # # return "bla" # return render_template("tagebuch_output.html", markdown_result=data, markdown_filename=filename) +def get_marp_url(): + if config_parser.prod_mode: + return "https://marp.swaghausen.de" + else: + return "http://localhost:4100" + +@app.route('/marp') +def redirect_to_marp(): + return redirect(get_marp_url(), code=302) + # return get_marp_url() + @app.route(URL_BASE_PATH + 'download', methods=['GET']) # @auth.login_required diff --git a/templates/return_result.html b/templates/return_result.html index ffafe84..649eef7 100644 --- a/templates/return_result.html +++ b/templates/return_result.html @@ -11,5 +11,6 @@ Download Markdown File Download PDF File + Go To Marp Server

{% endblock %} \ No newline at end of file