I need to make a server-side script run when a user from the browser clicks a button...
I\'ve been researching for a while, and can\'t figure it out.
What we hav
You are on the right way with your first approach, the child_process.spawn
variant. Ofcourse you can't put this in the HTML page, as it is then executed in the browser, not in the server, but you can easily create a request in the browser (AJAX or page load, depending on what you need), that triggers running this script in the server.