Refactoring and cleanup codebase (starting...)
This commit is contained in:
@@ -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!"})
|
||||
@@ -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")
|
||||
Reference in New Issue
Block a user