Update app.py
Browse files178 unmodified lines179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210178 unmodified lines
from flask import Flask, send_fileimport os
app = Flask(__name__)
@app.route('/graf_json', methods=['GET'])def get_json_file(): # Предполагаем, что файл с именем 'combined_data.json' уже создан filename = 'combined_data.json' # Проверяем, существует ли файл if os.path.isfile(filename): return send_file(filename, as_attachment=True) else: return "Файл не найден", 404
if __name__ == '__main__': app.run(debug=True)
if __name__ == '__main__': app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 7860)))app.py+27