From aab28c5765594e845ab6f8124c3befdbeba0003c Mon Sep 17 00:00:00 2001 From: drath Date: Sun, 23 Nov 2025 03:44:52 +0100 Subject: [PATCH] minify --- app/main.py | 16 +++++++++++++++- requirements.txt | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index 19697ab..287509f 100644 --- a/app/main.py +++ b/app/main.py @@ -1,9 +1,19 @@ from flask import Flask, render_template +from flask_minify import minify +from flask_compress import Compress +import waitress import ping3 +isProdution = True + # READ README YOU STUPID FUCK app = Flask(__name__.split('.')[0]) +Compress(app) +if isProdution: + minify(app=app, html=True, js=True, cssless=True) + + def isUp(host: str) -> bool: return bool(ping3.ping(host, timeout = 1)) @@ -30,4 +40,8 @@ def server(): return str(isUp("10.0.1.200")) if __name__ == '__main__': - app.run(host='0.0.0.0', port=8080, debug=True) \ No newline at end of file + if isProdution: + print("Starting waitress server") + waitress.serve(app, host='0.0.0.0', port=8080) + else: + app.run(host='0.0.0.0', port=8080, debug=True) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 1fe9781..1c20cf8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ Flask waitress Flask-Minify +flask-compress ping3 \ No newline at end of file