diff --git a/backend/latexdiff_web.py b/backend/latexdiff_web.py index b96c866..beea74c 100644 --- a/backend/latexdiff_web.py +++ b/backend/latexdiff_web.py @@ -5,6 +5,7 @@ DEBUG = (__name__ == '__main__') TIMEOUT_LIMIT = 600.0 +REDIR_ROOT = os.environ.get('REDIR_ROOT', None).lower() in ['true', '1', 'yes', 'y'] from flask import Flask, request, redirect, jsonify, send_from_directory from flask_cors import CORS, cross_origin @@ -24,13 +25,13 @@ def gen_redir(): @app.route('/') def send_index(): - if not os.path.exists('static'): + if REDIR_ROOT or not os.path.exists('static'): return gen_redir() return send_from_directory('static', 'index.html') @app.route('/') def send_web(path): - if not os.path.exists('static'): + if REDIR_ROOT or not os.path.exists('static'): return gen_redir() return send_from_directory('static', path)