ver Dec25th

added cache and upload function for setup
This commit is contained in:
David Chang
2023-12-25 14:40:30 +08:00
parent 2163a08a0d
commit 82e3353f65
7 changed files with 107 additions and 49 deletions

View File

@@ -96,6 +96,16 @@ def get_file():
# If the file is not found, return a 404 error
return jsonify({"error": "File not found"}), 404
@app.route("/setup/upload", methods=["POST"])
def upload_file():
# Retrieve filename from the POST request
if 'file_path' in request.form and 'file_data' in request.files:
file_path = request.form['file_path']
file = request.files["file_data"]
file.save(file_path)
return "File Uploaded"
else:
return jsonify({"error": "file_path and file_data are required"}), 400
@app.route('/platform', methods=['GET'])
def get_platform():