from flask import Flask, request
app = Flask(__name__)
eintraege = [] # speichert die Nachrichten (im Arbeitsspeicher)
@app.route("/pinnwand", methods=["GET", "POST"])
def pinnwand():
if request.method == "POST":
eintraege.append(request.form["nachricht"])
return redirect("/app/pinnwand")
liste = ""
for e in eintraege:
liste = liste + "
" + e + ""
return 'Pinnwand
' \
''
@app.route("/pinnwand", methods=["GET", "POST"])
def pinnwand():
if request.method == "POST":
eintraege.append(request.form["nachricht"])
return redirect("/app/pinnwand")
liste = ""
for e in eintraege:
liste = liste + "" + e + ""
return 'Pinnwand
' \
''
if __name__ == "__main__":
app.run(host="0.0.0.0", port=9008)