Compare commits

...

2 commits

Author SHA1 Message Date
0b0bda7813 Merge branch 'main' of git.md-phw.de:ElenaRJ/eis-website 2026-06-17 16:14:06 +02:00
2a26a062c6 Pinnwand 2026-06-17 16:11:00 +02:00

View file

@ -1,19 +1,23 @@
<<<<<<< HEAD
from flask import Flask, request, redirect
=======
from flask import Flask, request
>>>>>>> cc1572648571daae5f23f95b3bf9711011ffca50
app = Flask(__name__)
eintraege = [] # speichert die Nachrichten (im Arbeitsspeicher)
@app.route("/")
def hello():
return "Hallo aus meiner Flask-App! Willkommen in unseren Escape Room! Wuhuuuu es wird Gruselig"
@app.route("/frage", methods=["GET", "POST"])
def frage():
@app.route("/pinnwand", methods=["GET", "POST"])
def pinnwand():
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>'
eintraege.append(request.form["nachricht"])
return redirect("/app/pinnwand")
liste = ""
for e in eintraege:
liste = liste + "<li>" + e + "</li>"
return '<h1>Pinnwand</h1>' \
'<form method="post"><input name="nachricht">' \
'<button>Senden</button></form><ul>' + liste + '</ul>'
if __name__ == "__main__":
app.run(host="0.0.0.0", port=9008) # 90 + Raumnummer (Wir: 08)
app.run(host="0.0.0.0", port=9008)