Created
April 7, 2017 08:43
-
-
Save JamesDonnelly/eded2d8a5fda5247ec6461485f9149cc 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/minion?columns=behavior,icon,id,name_en,minion_race", | |
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] = { | |
behavior: a.behavior, | |
icon: a.icon, | |
name: a.name_en, | |
race: a.minion_race | |
} | |
}) | |
console.info(result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment