I couldn't think of a good title that really described what I'm looking for so I did my best. Basically I have a Flask server that has several endpoints. It holds data in a JSON file on my system. I have an endpoint called "/update_json" which I can pass a paramater like http://127.0.0.1:5000/update_json?json_key=json_value and it will update the json file with the key and value passed. So if I'm not mistaken it might not work on other system's since they won't have the json file correct? The specific code looks like this
@app.route("/update_json")
def update_json():
args = request.args
args = jsonify(args)
with open("static/data.json") as f:
data = json.load(f)
for key in args.json:
data["test"][key] = args.json[key]
data = json.dumps(data, indent=4)
with open("static/data.json", "w") as f:
f.write(data)
if request.args:
return "Succesfully updated the JSON"
else:
return "Please include some keys and values to update the JSON
if this won't work on other systems what's a possible solution. Thanks in advance