Frage-Formular

This commit is contained in:
lena_smd02 2026-07-01 18:45:01 +02:00
parent a8201a1f44
commit de7dbcf283

View file

@ -7,4 +7,25 @@ def hello():
return "Willkommen in unserem Escape Room!" return "Willkommen in unserem Escape Room!"
if __name__ == "__main__": 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)