I am experimenting with some web programming. I wrote a python API that will make a query to an SQL database and return a JSON. The API works as expected.
On the other hand, I have a controller where I make the GET request to use the JSON.
The GET request is made and the API gets rolling; however, when the API returns the JSON the following appears in the developer console of the browser:
Failed to load http://localhost:3000/api/s1r2_rep_fis: No 'Access- Control-Allow-Origin' header is present on the requested resource. Origin 'http://0.0.0.0:8000' is therefore not allowed access.
I guess this is due to permissions. My http server is run by python:
python -m http.server
The controller code is:
app.controller("test", function($scope, $http){
$http.get("http://localhost:3000/api/s1r2_rep_fis")
.then(function(response){
$scope.Clientes = response.data;
});
});
Please forgive me if I mix up some terms/technology, this is my first time using html/javascritp/angularJS.
Any help will be deeply appreciated