28 lines
570 B
Python
28 lines
570 B
Python
from flask import Flask, request
|
|
|
|
app = Flask(__name__)
|
|
|
|
|
|
@app.route("/")
|
|
def hello():
|
|
return "Glück Auf aus meinem Escape-Room!"
|
|
|
|
|
|
@app.route("/frage", methods=["GET", "POST"])
|
|
def frage():
|
|
if request.method == "POST":
|
|
if request.form["antwort"] == "4":
|
|
return "Richtig! Tür offen."
|
|
return "Leider falsch."
|
|
|
|
return (
|
|
'<form method="post">'
|
|
"Was ist 0+4? "
|
|
'<input name="antwort">'
|
|
"<button>OK</button>"
|
|
"</form>"
|
|
)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
app.run(host="0.0.0.0", port=9007)
|