Created
April 7, 2017 08:47
-
-
Save JamesDonnelly/cc347b039e9def4174657f66791c6ac1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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