diff --git a/back/app.py b/back/app.py index 6d90a9f..a2e940f 100644 --- a/back/app.py +++ b/back/app.py @@ -8,8 +8,6 @@ CORS(app, resources={r"/music/*": {"origins": "http://*"}}) with open('.users', 'r') as file: users = json.load(file) -print(users) - @app.route('/music/set', methods=['POST']) def set_content(): global cache @@ -18,12 +16,17 @@ def set_content(): for key in ['user', 'password']: if key in cache: del cache[key] + # with open('cache.txt', 'w') as f: + # f.write(str(cache)) return jsonify({'message': 'Content set successfully.'}) else: return jsonify({'message': 'Invalid user or password.'}) @app.route('/music/get', methods=['GET']) def display_content(): + global cache + # with open('cache.txt', 'r') as f: + # cache = f.read() return jsonify(cache) if __name__ == '__main__': diff --git a/user/test.py b/user/test.py index 062a852..078bbfa 100644 --- a/user/test.py +++ b/user/test.py @@ -43,7 +43,8 @@ def post(currentsong): else : return r.text -url = "http://192.168.1.58:3005" +url = "http://192.168.1.58:3005" #RUN +url = "http://127.0.0.1:5000" #DEV headers = {'Content-Type': 'application/json'} def main():