Guest User

Untitled

a guest
Aug 20th, 2019
76
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. """Es bsp. woni mer ned vorstelle chan isch das szenario
  2.  
  3. API endpoint /join/<join-uuid>
  4.  
  5. Da söt etz eigentlich ein ihtrag id db CampaignMember gmacht werde.
  6. Durch d'join UUID chani usefinde welere campaign es ahghört.
  7. Also irgendwie check ich ned wie ich gwüssi felder durch e view automatisch chan usfülle lah.
  8. """
  9.  
  10.  
  11. from flask import Flask
  12.  
  13. app = Flask(__name__)
  14.  
  15.  
  16. @app.route('/join/<join_uuid>')
  17. def hi(join_uuid):
  18. if join_uuid == "1234":
  19. return 'woah, you loaded campaign 1'
  20. elif join_uuid == '23':
  21. return 'woah, that\'s campaign 2'
  22.  
  23. return 'invalid join_uuid'
  24.  
  25.  
  26. if __name__ == '__main__':
  27. app.run()
RAW Paste Data