feat: /upload эндпоинт, кнопка Загрузить, прогресс-бары, скорость, версия v1.0.0
Deploy loadtest / validate (push) Waiting to run

This commit is contained in:
2026-07-10 08:07:36 +04:00
parent 7bb503420f
commit f50d8d5ce0
3 changed files with 192 additions and 13 deletions
+24 -2
View File
@@ -1,11 +1,33 @@
from flask import Flask, render_template
import time
from flask import Flask, render_template, request
app = Flask(__name__)
VERSION = '1.0.0'
@app.route('/')
def index():
return render_template('index.html')
return render_template('index.html', version=VERSION)
@app.route('/health')
def health():
return {'ok': True, 'version': VERSION}
@app.route('/upload', methods=['POST'])
def upload():
t0 = time.time()
total = 0
for f in request.files.values():
while True:
chunk = f.read(8192)
if not chunk:
break
total += len(chunk)
elapsed = round((time.time() - t0) * 1000)
return {'ok': True, 'bytes': total, 'elapsed_ms': elapsed}
if __name__ == '__main__':