Document picker code and architecture

This commit is contained in:
“Naeel”
2026-09-05 13:24:00 +03:00
parent 13ea0efcd7
commit e4b4dca53a
18 changed files with 437 additions and 2 deletions
+5
View File
@@ -5,27 +5,32 @@ from flask import Flask, render_template, send_from_directory
ROOT = Path(__file__).resolve().parent.parent
# Конфигурация демо содержит только разрешённые расширения для browser picker.
with (ROOT / "config.json").open(encoding="utf-8") as config_file:
CONFIG = json.load(config_file)
VERSION = "0.1.9"
# Flask нужен здесь только как статический сервер HTML, CSS и ES-модулей.
app = Flask(__name__, template_folder="templates", static_folder="static")
@app.route("/")
def index():
"""Возвращает demo-страницу и передаёт в неё версию и JSON-конфигурацию."""
return render_template("index.html", version=VERSION, config=CONFIG)
@app.route("/health")
def health():
"""Возвращает 200 для liveness-проверки платформы."""
return "ok", 200
@app.get("/upload-frontend/<path:filename>")
def upload_frontend(filename):
"""Отдаёт один frontend-файл из изолированного каталога upload/frontend."""
return send_from_directory(ROOT / "upload" / "frontend", filename)