1
I need to create a page using nodejs, which will contain a "Turn on/Off" button. By pressing this button I intend to make the call from the same route, but passing a parameter: on/off or 0/1, etc.. When making this call, I will treat the received parameter and then run a script called "on.js" or "off.js". These scripts will be in the same server folder. I imagined that in "File System" there would be something like PHP’s "exec()" function, but I couldn’t find it. In PHP, for example, something like exec( "/meu_path/meu_script.js $onOff");
. How do I execute a script on Node?
I think this solves your problem https://udgwebdev.com/node-js-para-layers-child-process/
– Rafael Salomão
Rafael, grateful for the return. I think this solves the problem and found it very useful. However I ended up doing only with the
require
as suggested by my colleague Sergio in the other reply. I already got it that way. Thank you!– wBB
quiet, if solved I’m happy!
– Rafael Salomão