Refactoring and cleanup codebase (starting...)

This commit is contained in:
2025-02-23 14:47:10 +05:00
parent d0e91f5259
commit 8a8cf8af30
16 changed files with 1319 additions and 1741 deletions
+19
View File
@@ -0,0 +1,19 @@
from email.policy import default
from jinja2 import TemplateNotFound
from flask import Blueprint, render_template, jsonify, abort
webui = Blueprint('webui', __name__, url_prefix='/telezab')
@webui.route('/', defaults={'index'})
def index():
try:
return render_template(index.html)
except TemplateNotFound:
abort(404)
@webui.route('/data')
def get_data():
return jsonify({"message": "Данные из frontend!"})
+13
View File
@@ -0,0 +1,13 @@
from flask import Blueprint, render_template, jsonify
webui = Blueprint('webui', __name__, url_prefix='/telezab')
@webui.route("/heartbeat")
def heartbeat():
return jsonify({"status": "healthy"})
@webui.route('/', defaults={'path': ''})
@webui.route('/<path:path>')
def catch_all(path):
return webui.send_static_file("index.html")