Commit e889026b authored by Sam Muirhead's avatar Sam Muirhead

move api response

parent 9e1e1ae8
{
"generated_at": "Thu, 31 Jan 2019 07:19:19 GMT",
"icons": [
{
"attribution": "bee by Juan Sebastian Rickenmann from Noun Project",
......@@ -414,4 +413,4 @@
"year": 2013
}
]
}
\ No newline at end of file
}
......@@ -39,14 +39,23 @@ console.log(license1)
// container.setAttribute('class', 'container')
// app.appendChild(container)
fetch('https://gitlab.com/cameralibre/cut-copy-and-paste/raw/master/Animation-Workshop/api-response')
.then(function(response) {
// delete response.generated_at
response.json()
console.log(response)
})
//
// fetch('https://gitlab.com/cameralibre/cut-copy-and-paste/raw/master/Animation-Workshop/api-response')
// .then(res => res.json()
// .then(data => console.log(data))
async function getData()
{
//await the response of the fetch call
let response = await fetch('https://gitlab.com/cameralibre/cut-copy-and-paste/raw/master/Animation-Workshop/api-response');
//proceed once the first promise is resolved.
let data = await response.json()
//proceed only when the second promise is resolved
return data;
}
//call getData function
getData()
.then(data => console.log(data));//lo
// .then(function(myJson) {
// console.log(JSON.stringify(myJson));
// });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment