minify
This commit is contained in:
16
app/main.py
16
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)
|
||||
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)
|
||||
@@ -1,4 +1,5 @@
|
||||
Flask
|
||||
waitress
|
||||
Flask-Minify
|
||||
flask-compress
|
||||
ping3
|
||||
Reference in New Issue
Block a user