exports.endpoint = function(request, response) {
axios = require("axios");
var clientID = 'e86d0ad3-1ce0-4a21-87dc-90944263efea';
var instance = axios.create({
baseURL: 'https://api.fanburst.com/',
timeout: 1000,
headers: {'Authorization': 'Bearer 31b0308097644ee97fd027fc8188ffc26fbb43d60a9da3f40fac89c609892e75'}
});
// fanburstAPIResponse = '';
instance.get('resolve?url=https://fanburst.com/vasta/they-back-it-up-vasta-infuze-remix&CLIENT_ID=' + clientID)
.then(function (res) {
fanburstAPIResponse = res;
})
.then(function (fanburstAPIResponse){
response.setHeader("Access-Control-Allow-Origin", "*");
response.end(JSON.stringify(fanburstAPIResponse));
})
.catch(function (error) {
console.log(error);
});
// .then(function (data) {
// const artistData = data;
// response.setHeader("Access-Control-Allow-Origin", "*");
// response.end(JSON.stringify(artistData));
// })
}