From f001691283c0fc28498d770c5883f47d970793cf Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Thu, 2 Nov 2023 21:37:18 +1100 Subject: [PATCH] fix: Old generator path --- server.py | 8 +++++--- templates/generator.html | 10 +++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/server.py b/server.py index 34c5726..0abf763 100644 --- a/server.py +++ b/server.py @@ -52,14 +52,16 @@ def handshake(): # return request.path return send_from_directory('templates/assets/js', request.path.split('/')[-1]) +@app.route('/generator/') +def removeTrailingSlash(): + return render_template(request.path.split('/')[-2] + '.html') # Main routes - @app.route('/') def index(): handshake_scripts = "" # If localhost, don't load handshake - if request.host == "localhost:5000" or request.host == "127.0.0.1:5000" or os.getenv('dev') == "true": + if request.host == "localhost:5000" or request.host == "127.0.0.1:5000" or os.getenv('dev') == "true" or request.host == "test.nathan.woodburn.au": handshake_scripts = "" return render_template('index.html', handshake_scripts=handshake_scripts) @@ -68,7 +70,7 @@ def index(): def catch_all(path): handshake_scripts = "" # If localhost, don't load handshake - if request.host == "localhost:5000" or request.host == "127.0.0.1:5000" or os.getenv('dev') == "true": + if request.host == "localhost:5000" or request.host == "127.0.0.1:5000" or os.getenv('dev') == "true" or request.host == "test.nathan.woodburn.au": handshake_scripts = "" # If file exists, load it if os.path.isfile('templates/' + path): diff --git a/templates/generator.html b/templates/generator.html index 1771344..1e2d4a5 100644 --- a/templates/generator.html +++ b/templates/generator.html @@ -12,11 +12,11 @@ - - - - - + + + + +