import axios from "axios";
axios.post('https://id.twitch.tv/oauth2/token', {
client_id: 'iaxcs84csy2v5mvzueo69y',
client_secret: '6uj5ltv3l7uljc5k',
grant_type: 'client_credentials'
})
.then(function (response) {
console.log(response);
})
.catch((e) {
console.log(e);
});
axios.get('https://api.twitch.tv/helix/search/channels?query=loserfruit', {
headers: {
'Client-Id': 'iwnng4cs84csy2v5ueo69y',
'Authorization': 'Bearer 1n44alq5a9n4e9oz8j4'
}})
.then(function (response) {
console.log(response);
})
.catch((e) {
console.log(e);
});
Is a basic addition to catch and log the error.
You may want to complete a javascript primer before continuing