From 82bd9a7a9bf4e53ed7ade2b4e112c7d1f955a114 Mon Sep 17 00:00:00 2001 From: Dylan De Faoite Date: Tue, 27 Jan 2026 11:59:01 +0000 Subject: [PATCH] add upload post endpoint in flask app --- server/app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/app.py b/server/app.py index 053e813..1d791c5 100644 --- a/server/app.py +++ b/server/app.py @@ -1,9 +1,13 @@ from flask import Flask, jsonify, request +from flask_cors import CORS import pandas as pd app = Flask(__name__) -@app.route('/upload', methods=['POST']) +# Allow for CORS from localhost:5173 +CORS(app, resources={r"/*": {"origins": "http://localhost:5173"}}) + +@app.route('/upload_posts', methods=['POST']) def upload_data(): if "file" not in request.files: return jsonify({"error": "No file part in the request"}), 400