Flask-Notizen/app.py

17 lines
393 B
Python
Raw Permalink Normal View History

2024-08-25 21:25:23 +02:00
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