I have a node express project with the files oriented like this (webstorm editor):
I would like to pass a variable from the marked index.js to app.js so that I can write that variable in data.json at the end.
I am still new to node.js and still confused about the client/server theory. It will be much easier if there is a way to write the data directly from index.js to data.json, or any other json file, but I think that this is not possible according to previous answers. Please correct me if I’m wrong.