I have implemented server side method makeContract, it takes an object inputData as an argument and generates docx-document as nodebuffer data. I call this method from the client on form submit.
Just for now makeContract doesn’t return anything, just writes this data to my local filesystem.
I need some way to return generated file and to send in to client, when form submission appears.
At least in our app, when we have to return a file to the client we return only the URL, and if the user wants to open it, they can click to open it (we sometimes also window.open for them).
Because we usually generate PDFs with different services and store them either on Cloudinary or S3.