I need to use user's setup configuration in a Flask APP. The user will post certain data ( id, age etc) and I have to use this configuration in other methods as well. Now this is what I have tried which is not working
data_config = {}
@app.route('/api/data', methods=['POST'])
def check():
payload = request.get_json()
data_config = payload
print(data_config)
return jsonify(data_config)
I am getting the data in data_config
. But when I make the following call I am getting data empty
@app.route('/api/get_config', methods=['GET'])
def getCofig():
return jsonify(data_config)
How can I fix this ?