How to enable CORS in order to obtain information from API REST , Because now i have this error :
XMLHttpRequest cannot load http://localhost:8080/bonita/loginservice. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost’ is therefore not allowed access.
when i execute this code:
'use strict';
(function(){
var appMainModule = angular.module('appMainModule',['ngBonita']);
appMainModule.config(function(bonitaConfigProvider){
bonitaConfigProvider.setBonitaUrl('http://localhost:8080/bonita');
});
appMainModule.controller('AppController',['$scope','$log','bonitaConfig','bonitaAuthentication','ProcessDefinition','HumanTask',function($scope,$log,bonitaConfig,bonitaAuthentication,ProcessDefinition,HumanTask){
bonitaAuthentication.login('root.root','root').then(function(){
$log.log('Usuari logejat: '+bonitaConfig.getUserName() + '(identificador: '+ bonitaConfig.getUserId() +')');
})
}]);
})();'
Regards.