(feat): Init concept of coming soon landing page

This commit is contained in:
Blake Ridgway 2025-01-05 21:03:42 -06:00
parent 18bcafe29b
commit f8f8c773cc
9 changed files with 179 additions and 77 deletions

View file

@ -1,10 +1,26 @@
from flask import Flask, render_template
# noinspection PyPackageRequirements
from flask import Flask, render_template, request, jsonify
from database import init_db, add_email
app = Flask(__name__)
init_db()
@app.route("/")
def index():
return render_template("index.html")
@app.route("/subscribe", methods=["POST"])
def subscribe():
data = request.get_json()
email = data.get('email')
if not email:
return jsonify({"error": "No email provided"}), 400
if add_email(email):
return jsonify({"message": "Email has been added"}), 201
else:
return jsonify({"error": "Email already exists"}), 400
if __name__ == "__main__":
app.run(debug=True)