Spaces:
Sleeping
Sleeping
Commit
•
3a4e108
1
Parent(s):
eb25ab5
Update app.py
Browse files
app.py
CHANGED
@@ -12,10 +12,11 @@ def index():
|
|
12 |
def avp():
|
13 |
incoming = request.get_json()
|
14 |
print(incoming)
|
15 |
-
#
|
16 |
-
|
17 |
-
incoming[
|
18 |
-
|
|
|
19 |
return jsonify(response)
|
20 |
if __name__ == '__main__':
|
21 |
app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 7860)))
|
|
|
12 |
def avp():
|
13 |
incoming = request.get_json()
|
14 |
print(incoming)
|
15 |
+
# Проверка наличия ключа "bazis" во входящем JSON
|
16 |
+
if "bazis" in incoming:
|
17 |
+
response = {"bazis": incoming["bazis"] - 1}
|
18 |
+
else:
|
19 |
+
response = {"error": "Key 'bazis' not found"}
|
20 |
return jsonify(response)
|
21 |
if __name__ == '__main__':
|
22 |
app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 7860)))
|