30 lines
1,022 B
Python
30 lines
1,022 B
Python
from flask import Flask, render_template, request
|
|
|
|
app = Flask(__name__, static_folder="assets", static_url_path="/assets")
|
|
|
|
|
|
@app.route("/")
|
|
@app.route("/app/")
|
|
def hello():
|
|
return render_template("index.html")
|
|
|
|
|
|
@app.route("/raetsel", methods=["GET", "POST"])
|
|
@app.route("/raetsel/", methods=["GET", "POST"])
|
|
@app.route("/app/raetsel", methods=["GET", "POST"])
|
|
@app.route("/app/raetsel/", methods=["GET", "POST"])
|
|
@app.route("/frage", methods=["GET", "POST"])
|
|
@app.route("/frage/", methods=["GET", "POST"])
|
|
@app.route("/app/frage", methods=["GET", "POST"])
|
|
@app.route("/app/frage/", methods=["GET", "POST"])
|
|
def raetsel():
|
|
if request.method == "POST":
|
|
if request.form["antwort"] == "4":
|
|
return render_template("raetsel.html", ergebnis="Richtig! Das Stadiontor öffnet sich.")
|
|
return render_template("raetsel.html", ergebnis="Leider falsch, du bist wohl kein wahrer Fan.")
|
|
|
|
return render_template("raetsel.html")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
app.run(host="0.0.0.0", port=9007)
|