Spaces:
Paused
Paused
File size: 385 Bytes
2cdc05c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
from flask import Flask, jsonify, request
from game_logic import handle_command
app = Flask(__name__)
@app.route('/command', methods=['POST'])
def command():
data = request.json
username = data['username']
command = data['command']
result = handle_command(username, command)
return jsonify({'result': result})
if __name__ == '__main__':
app.run(debug=True)
|