server implementation

This commit is contained in:
√(noham)²
2024-02-29 20:50:11 +01:00
parent 4eb09784d6
commit 37eb055d2c
3 changed files with 46 additions and 2 deletions

16
server.py Normal file
View File

@@ -0,0 +1,16 @@
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/music/set', methods=['POST'])
def set_content():
global cache
cache = request.get_json()
return jsonify({'message': 'Content set successfully'})
@app.route('/music/display', methods=['GET'])
def display_content():
return jsonify(cache)
if __name__ == '__main__':
app.run(debug=True)