Yes, you are right! It is really shorten.
But the idea of this post is to use Axios as short as I could. So that beginners in Axios, like me), can see how to start using it understanding the minimum usage of it. Like an entry point for study.
Great point, thanks for your comment!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Why using Axios when you can use JS's fetch()? Short API GET? Use JS - It's even simpler and without any dependencies.
fetch('api.publicapis.org/entries')
.then(resp => resp.json())
.then(data => data.entries.map((e) => {
let p = document.createElement('p')
let a = document.createElement('a')
p.appendChild(a);
a.setAttribute('href', e.Link)
a.innerHTML = e.API
document.getElementById('data').appendChild(p)
}))
Yes, you are right! It is really shorten.
But the idea of this post is to use Axios as short as I could. So that beginners in Axios, like me), can see how to start using it understanding the minimum usage of it. Like an entry point for study.
Great point, thanks for your comment!