I have Apache httpd server and node.js. I need to emulate the actual JSON data that changes every time.
I found, that I node Js can be run as a server in standalone mode:
var http = ('http'); Http.createServer (function (req, res) {res.writeHead (200, {'Content-Type': 'text / plain'}); res.end ('Hello World \ n');}). Listen (8124, "127.0.0.1"); Console.log ('Server running http://127.0.0.1:8124/') This is cool, but I can not access it via AJAX request, Because there is a separate port
Question: How can I do this, to run this script, reach through different paths, eg (as standanol is not running on any other port)
Thanks,
You can proxy the connection node to the main webserver. By c. There is a great tutorial on Dailyjs - although it's not about Apache but NGN
Comments
Post a Comment