repository to manage all files for 1_2_oder_3 interaction game for Inf2/2 Interaktionen SoSe23 from Engert, Caliskan and Bachiri
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

router.py 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. from flask import Flask, jsonify, Response, request
  2. app = Flask(__name__)
  3. @app.route('/GETQUESTION', methods=['GET'])
  4. def test():
  5. test_dict = {'TEST': 'Dies ist eine Testfrage',
  6. 'firstanswer': 'erste Antwort',
  7. 'secondanswer': 'zweite Antwort',
  8. 'thirdanswer': 'dritte Antwort'}
  9. return jsonify(test_dict)
  10. @app.route('/connection', methods=['GET'])
  11. def connection():
  12. return Response(status=200)
  13. @app.route('/teamsize', methods=['POST'])
  14. def teamsize():
  15. team_size = request.json
  16. print(team_size)
  17. print(type(team_size))
  18. return Response(status=200)
  19. @app.route('/scoreboard', methods=['GET'])
  20. def scoreboard():
  21. pass
  22. @app.route('/check', methods=['GET'])
  23. def check():
  24. pass
  25. @app.route('/reset', methods=['GET'])
  26. def reset():
  27. return Response(status=200)
  28. def main():
  29. ## ASUS Router
  30. # app.run(host='192.168.50.79', port=5555, debug=True)
  31. ## Postman
  32. app.run(host='127.0.0.1', port=5555, debug=True)
  33. if __name__ == '__main__':
  34. main()