Hi all,
I have Apache httpd server and node.js. I need to emulate real JSON data which changes every time.
I found, that I can run node.js as server in standalone mode like this:
var http = require('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 at http://127.0.0.1:8124/')
It's cool, but I can't access it via AJAX request, as there's different port.
Question: How I can, run this script, accessed via different path , e.g. http://localhost/json (not as standanole running at another port)
Thanks,