I'm incredably new at full stack development - so I might have some basic principles all wrong ...
I've buildt a small app with express and EJS. On my EJS page one can press a button and a JavaScript object is generated. My goal is for this object to be readable as a file from the www. Basically an API. The file should exists untill the button is pressed again - and then updated.
I've figured out how to get data from my MongoDB and pass it over to EJS - so my page is working just the way it should. But is it possible to pass data back to express and have it serve another template that just displays this javascript object (as a string I guess)?
Been googling for a few hours now, but I'm probably missing some terminology here. I hope someone can point me in the right direction (if there are any)!
I have no code to show you - since I don't know where to start :-/