Flask-Notizen/app.py
2024-08-25 21:25:23 +02:00

17 lines
No EOL
393 B
Python

from flask import *
app = Flask("Witze")
notes = []
@app.route("/")
def root():
return render_template("index.html")
@app.route("/note" ,methods=["POST","GET"])
def note():
if request.method == "POST":
notes.append(str(request.data)[3:-2])
print(f"Notiz hinzugefügt: {request.data}")
return ["juhuuuu"]
elif request.method == "GET":
return notes