PHP developer here...I wrote a simple script in Node.js that pings all of my internal servers and logs the response it received to the console. I just need to create a simple endpoint at the end of this file that returns the data when a GET request is made to it rather than logging to the console.In PHP I would simply type “return responsedata” at the end of the script and then point the browser to this file. Just for the sake of comparison, what is the simplest way to do this in Node.js without using any kind of framework and without any unnecessary abstractions?
Submitted November 09, 2018 at 04:05PM by Cessna911
No comments:
Post a Comment