From ecd42c85add030f412940e58977c525ca412f939 Mon Sep 17 00:00:00 2001 From: "kam (from the studio)" Date: Tue, 4 Oct 2022 17:08:12 +0200 Subject: [PATCH] coding documentation --- pad-bis.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pad-bis.py b/pad-bis.py index 87ba48f..fb97e20 100644 --- a/pad-bis.py +++ b/pad-bis.py @@ -20,8 +20,6 @@ load_dotenv(dotenv_path=dotenv_path) load_dotenv() # prefix to add /soupboat/padliography to all the routes -# and to leave the @app.route() decorator more clean - class PrefixMiddleware(object): def __init__(self, app, prefix=""): self.app = app @@ -42,7 +40,7 @@ class PrefixMiddleware(object): app = Flask(__name__) # Get the URL prefix for the soupboat -# and register the middleware to use our base_url as prefix on all the requests +# register the middleware to use our base_url as prefix on all the requests base_url = os.environ.get('BASE_URL', '') app.wsgi_app = PrefixMiddleware(app.wsgi_app, prefix=base_url) @@ -109,6 +107,7 @@ def get_pads(): return pads +# Routes @app.route('/') def home(): @@ -140,5 +139,8 @@ def api(): return response + + +# Get the port and mount the app port = os.environ.get('FLASK_RUN_PORT', '') app.run(port=port)