mirror of
https://github.com/NohamR/AM-Exporter.git
synced 2026-05-25 04:07:11 +00:00
server implementation
This commit is contained in:
16
server.py
Normal file
16
server.py
Normal 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)
|
||||
Reference in New Issue
Block a user