Hi again.
Now I have this error, and I want to know if its the configuration of the server I am working or Slim configuration.
So my API is running in a server in localhost:8080, i was told, in order to access my API outside my server, i should write xxx.xxx.xxx:8080
And i did tried it like this. (I start the API with this command php -S localhost:8080 -t public public/index.php
)
$http({
url:'http://xxx.xxx.xxx.xxx:8080/login',
method:"POST",
data:{user:$scope.user, password:$scope.password}
})
In my API the code is like this.
$app->post('/login', function ($request, $response) {
//Parametros que se pasan a la api
$input = $request->getParsedBody();
$req = $input['usuario'];
$md5pass = md5($input['password']);
$sth = $this->db->prepare("query");
//bindParam pasandole los parametros para evitar injecciones sql
$sth->bindParam("password", md5($input['password']));
$sth->bindParam("usuario", $input['usuario']);
$sth->execute();
$todos = $sth->fetchAll();
$cliente_id = $todos->cliente_id;
....
But i get this error when trying to call xxx.xxx.xxx:8080/login
'OPTIONS http://xxx.xxx.xxx.xxx:8080/login net::ERR_CONNECTION_REFUSED'
Any clue why I am getting this error and how to solve it.
Thanks in advance for your time.