Revamp of backend method structure; Proxy for any URL

This commit is contained in:
James Barnsley
2017-10-04 16:47:15 +13:00
parent dcdecd989a
commit b2c7478cf9
12 changed files with 370 additions and 96 deletions

View File

@ -24,7 +24,9 @@ const sendRequest = ( dispatch, getState, endpoint, method = 'GET', data = false
// prepend the API baseurl, unless the endpoint already has it (ie pagination requests)
var url = 'https://api.spotify.com/v1/'+endpoint
if (endpoint.startsWith('https://api.spotify.com/')) url = endpoint;
if (endpoint.startsWith('https://api.spotify.com/')){
url = endpoint;
}
// create our ajax request config
var config = {