2015-06-09 17:16:29 +00:00
|
|
|
var DEBUG = true;
|
2015-05-09 19:00:14 +00:00
|
|
|
|
|
|
|
var service = angular.module('seHub.services', []);
|
|
|
|
|
|
|
|
service.factory('apiService', ['$http', function($http) {
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
getUserByToken: function(token){
|
|
|
|
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/getUserByToken/" + token;
|
|
|
|
req = {
|
|
|
|
method : "GET",
|
|
|
|
url : url
|
|
|
|
|
2015-06-10 10:36:31 +00:00
|
|
|
};
|
|
|
|
return $http(req);
|
|
|
|
},
|
|
|
|
getAllCampuses: function(token){
|
|
|
|
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/Campuses/" + token;
|
|
|
|
req = {
|
|
|
|
method : "GET",
|
|
|
|
url : url
|
|
|
|
|
2015-05-09 19:00:14 +00:00
|
|
|
};
|
|
|
|
return $http(req);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
}]);
|