I am using application craft as front-end (at application craft server), cakephp as back-end which (installed in localhost- wamp server).
The code below is the part where i used ajax to connect to localhost from application craft:
var params = {name : "madhan",id: 1};
app.httpRequest("http://client1.localhost/ezfit-be/users/index",
"POST",function(data, error, httpResponse){
debugger;
if (error === false){
//app.setValue("testlabel", data.results[0].formatted_address);
alert(data);
} else {
alert("Cannot locate it");
}
}, params , "json" );
}
}
However when i run it, it says that unable to connect to the address. I believe that my localhost is not allowing request from another domain.
I tried setting up a virtual host (client1.localhost) but it still gave me the same error
How can i setup my wamp to allow request from other domains?