http://coldfusion.com logo
#cfml-general
Title
# cfml-general
g

gsr

06/06/2022, 6:16 PM
can i run node with cfexecute
m

mitch

06/06/2022, 6:37 PM
yes
g

gsr

06/06/2022, 6:47 PM
any idea how, i wouold love to explore
because i want to install a package in node and want to run with cfexecute so i can store the data
m

mitch

06/06/2022, 9:34 PM
<cfexecute  name = "node" arguments = " hello.js" timeout = "60" variable="message" errorVariable="error_message"></cfexecute>
<cfdump var="#message#">
something like the following should work
g

gsr

06/06/2022, 11:11 PM
but you are running js with cfexecute, that is not is gonna work
m

mitch

06/07/2022, 7:56 AM
the program running is in name="node", hello.js is the argument passed which is where i just put a hello world to test it
p

paul

06/07/2022, 7:56 AM
It's running ( calling ) out to th eoperating system and running nodejs passing in the node file.
Mitch is correct this is how you do it.
Though personally I'd deploy that as a seperate service and call it with cfhttp
g

gsr

06/07/2022, 11:40 AM
interesting with cfhttp, can you provide me an example
i am trying to use one module of nodejs and want to fetch data
p

paul

06/07/2022, 10:07 PM
Jus setup your node app as a API and interfeace with it over http
👍 1
2 Views