diff --git a/site/app.py b/site/app.py index bf8fe95..4476248 100644 --- a/site/app.py +++ b/site/app.py @@ -1,18 +1,15 @@ import json -import sys from pathlib import Path from flask import Flask, render_template, send_from_directory ROOT = Path(__file__).resolve().parent.parent -if str(ROOT) not in sys.path: - sys.path.insert(0, str(ROOT)) with (ROOT / "config.json").open(encoding="utf-8") as config_file: CONFIG = json.load(config_file) -VERSION = "0.1.2" +VERSION = "0.1.3" app = Flask(__name__, template_folder="templates", static_folder="static") @@ -32,10 +29,5 @@ def upload_frontend(filename): return send_from_directory(ROOT / "upload" / "frontend", filename) -from routes.api_bp import register_api - -register_api(app, CONFIG) - - if __name__ == "__main__": app.run(debug=False, host="0.0.0.0", port=5000) \ No newline at end of file diff --git a/site/routes/__init__.py b/site/routes/__init__.py deleted file mode 100644 index 5b3e2cb..0000000 --- a/site/routes/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Маршруты демо-обёртки.""" \ No newline at end of file diff --git a/site/routes/api_bp.py b/site/routes/api_bp.py deleted file mode 100644 index 4c1e8ae..0000000 --- a/site/routes/api_bp.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Демо API: переиспользуемый upload_refs и заглушка обработки.""" - -from flask import Blueprint, jsonify, request - -from upload.backend.session import get_files -from upload.backend.upload_refs import create_upload_refs_blueprint - - -def register_api(app, cfg): - app.register_blueprint(create_upload_refs_blueprint(cfg)) - demo = Blueprint("demo_api", __name__, url_prefix=cfg.get("apiPrefix", "/api")) - - @demo.post("/process") - def process(): - data = request.get_json(silent=True) or {} - sid = data.get("session", "") - files = get_files(sid) - if files is None: - return jsonify({"ok": False, "error": "Session not found"}), 404 - return jsonify({ - "ok": True, - "session": sid, - "files": [{"name": name, "size": len(content)} for name, content in files], - }) - - app.register_blueprint(demo) \ No newline at end of file diff --git a/site/templates/index.html b/site/templates/index.html index e441a56..65a57c0 100644 --- a/site/templates/index.html +++ b/site/templates/index.html @@ -18,7 +18,6 @@ -
@@ -29,15 +28,10 @@ -