Skip to content

Instantly share code, notes, and snippets.

@BrychanOdlum
Created December 23, 2018 08:42
Show Gist options
  • Save BrychanOdlum/1d14e5601c73382c3c7fc644559f97f8 to your computer and use it in GitHub Desktop.
Save BrychanOdlum/1d14e5601c73382c3c7fc644559f97f8 to your computer and use it in GitHub Desktop.
Genius example
const axios = require('axios');
const fetchdata = async function(event, context) {
try {
const res = await axios({
method: 'post',
url: `https://api.genius.com/search?q=test`,
headers: {
'Authorization': 'Bearer TOKEN'
},
});
console.log(res.response);
return res;
} catch (error) {
console.error(error);
}
return null;
};
fetchdata();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment