I have a flask app that is accessed using the /get_data
endpoint and providing a number as an id (127.0.0.1:55555/get_data=56
)
@app.route('/get_data=<id>')
def get_vod_tree(id):
...
return render_template('index.html')
It invokes a function that fetches some data under that id and creates one json file [static/data.json] with the collected data and then returns render_template('index.html').
In the index.html there is a call to ../static/data_tree.js which in turn reads the json file and outputs a visualization in the browser using d3.js.
When the app runs, I get the same output on the browser even when I use a different id and the json file changes. It only works if I reload the app and then access the url.
My question is: How can I make sure that multiple users get the different outputs according to the id or how can I reload the app when I hit the endpoint.
Afterthought: If multiple users are using the app then there is only one file created each time