Spaces:
Runtime error
Runtime error
File size: 671 Bytes
f18f04b 3b33a44 f18f04b 3b33a44 f18f04b 3b33a44 f18f04b 3b33a44 7b4beb8 3b33a44 f18f04b 7b4beb8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import flask
from flask import request, jsonify
import os
import json
from dotenv import load_dotenv
load_dotenv()
app = flask.Flask(__name__, template_folder="./")
@app.route('/')
def index():
return flask.render_template('index.html')
@app.route("/avp", methods=["POST"])
def avp():
incoming = request.get_json()
print(incoming)
# Изменение значений ключей на единицу меньше
modified_data = {key: int(value) - 1 for key, value in incoming.items()}
response = {"bazis": modified_data}
return jsonify(response)
if __name__ == '__main__':
app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 7860))) |