1
0
mirror of https://github.com/danbee/mpd-client synced 2025-03-04 08:39:09 +00:00
mpd-client/assets/js/services/api.service.js
2014-03-21 11:13:34 +00:00

19 lines
399 B
JavaScript

mpdClient.factory('api', function ($rootScope, $http, $resource) {
var apiUrl = '/api'
return {
sendCommand: function (command) {
$http({ method: 'PUT', url: apiUrl + '/control/' + command })
},
getStatus: function () {
return $http({ method: 'GET', url: apiUrl + '/status' })
},
getQueue: function () {
return $resource(apiUrl + '/queue')
}
}
})