Frage-Formular
This commit is contained in:
parent
a8201a1f44
commit
de7dbcf283
1 changed files with 22 additions and 1 deletions
23
app/app.py
23
app/app.py
|
|
@ -7,4 +7,25 @@ def hello():
|
|||
return "Willkommen in unserem Escape Room!"
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host="0.0.0.0", port=9011) # 90 + Raumnummer
|
||||
app.run(host="0.0.0.0", port=9011) # 90 + Raumnummer
|
||||
|
||||
|
||||
from flask import Flask, request
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route("/")
|
||||
def hello():
|
||||
return "Hallo aus meiner Flask-App!"
|
||||
|
||||
@app.route("/frage", methods=["GET", "POST"])
|
||||
def frage():
|
||||
if request.method == "POST":
|
||||
if request.form["antwort"] == "8":
|
||||
return "Richtig!"
|
||||
return "Leider falsch."
|
||||
return '<form method="post">Was ist 3 + 5? ' \
|
||||
'<input name="antwort"><button>OK</button></form>'
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host="0.0.0.0", port=9011)
|
||||
Loading…
Reference in a new issue