diff --git a/app.py b/app.py index 91d8dc1..02d8b7a 100644 --- a/app.py +++ b/app.py @@ -15,8 +15,8 @@ def action(): # put application's code here checkedUserID = data['CheckedUserID'] response = { - "killedUserId": "", - "isEndGame": "", + "killedUserId": None, + "isEndGame": None, "checkedRole": False } @@ -40,12 +40,12 @@ def action(): # put application's code here return jsonify(response), 200 -@app.route('/create_game', methods=["POST"]) +@app.route('/create_chat', methods=["POST"]) def create(): - TCI = request.json['chatID'] + tci = request.json['chatID'] cursor = db.connection.cursor() - db.query_ins_chat(TCI, cursor) - db.close(cursor) + db.query_ins_chat(tci, cursor) + return 'ok', 200 @app.route('/start_game', methods=["POST"]) @@ -60,5 +60,6 @@ def start(): # Команда принимает на вход return "", resp + if __name__ == '__main__': - app.run() + app.run(host="0.0.0.0", debug=True) diff --git a/db.py b/db.py index 15d0a02..3816b95 100644 --- a/db.py +++ b/db.py @@ -51,3 +51,4 @@ def query_change(x): def close(cur): cur.close() + diff --git a/requirements.txt b/requirements.txt index b8dc338..fae349d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,5 +5,5 @@ Flask==2.3.2 itsdangerous==2.1.2 Jinja2==3.1.2 MarkupSafe==2.1.3 -psycopg2==2.9.7 +psycopg2-binary==2.9.7 Werkzeug==2.3.7