Skip to content

Instantly share code, notes, and snippets.

@JamesDonnelly
Created April 7, 2017 08:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamesDonnelly/cc347b039e9def4174657f66791c6ac1 to your computer and use it in GitHub Desktop.
Save JamesDonnelly/cc347b039e9def4174657f66791c6ac1 to your computer and use it in GitHub Desktop.
const config = {
method: 'GET',
mode: 'cors'
}
fetch(
"http://api.xivdb.com/mount?columns=icon,id,name_en",
config
)
.then(response => response.json())
.then(response => {
process(response);
})
.catch(e => console.error(e));
function process(response) {
let result = {};
response.forEach(a => {
result[a.id] = {
icon: a.icon,
name: a.name_en
}
})
console.info(result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment