add upload post endpoint in flask app

This commit is contained in:
2026-01-27 11:59:01 +00:00
parent 524a5d2619
commit 82bd9a7a9b

View File

@@ -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