change api endpoint

This commit is contained in:
√(noham)²
2024-03-01 17:27:38 +01:00
parent 3c9f01aa7d
commit 55253bec44
2 changed files with 4 additions and 2 deletions

View File

@@ -1,6 +1,8 @@
from flask import Flask, request, jsonify
from flask_cors import CORS
app = Flask(__name__)
CORS(app, resources={r"/music/*": {"origins": "http://127.0.0.1:5500"}})
@app.route('/music/set', methods=['POST'])
def set_content():
@@ -8,7 +10,7 @@ def set_content():
cache = request.get_json()
return jsonify({'message': 'Content set successfully'})
@app.route('/music/display', methods=['GET'])
@app.route('/music/get', methods=['GET'])
def display_content():
return jsonify(cache)