From 92b8e75aa56aebcfeaee41a8407089dd280e5d56 Mon Sep 17 00:00:00 2001
From: Tamas Gal <tgal@km3net.de>
Date: Tue, 8 Jan 2019 23:11:01 +0100
Subject: [PATCH] Update flask script to include static site generation

---
 km3mon.py | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/km3mon.py b/km3mon.py
index d099b92..c68f2a2 100644
--- a/km3mon.py
+++ b/km3mon.py
@@ -1 +1,21 @@
+import sys
+from flask_frozen import Freezer
 from app import app
+
+freezer = Freezer(app)
+
+
+@freezer.register_generator
+def index():
+    yield "/index.html"
+    yield "/static/css/bootstrap.min.css"
+    yield "/static/css/main.css"
+    yield "/static/js/jquery-3.3.1.slim.min.js"
+    yield "/static/js/bootstrap.min.js"
+
+
+if __name__ == '__main__':
+    if len(sys.argv) > 1 and sys.argv[1] == "build":
+        freezer.freeze()
+    else:
+        app.run(port=8000)
-- 
GitLab