Closed Youdaman closed 5 years ago
Also, that URL might not be a good example as it doesn't return JSON but rather returns a HTML page.
Thanks @Youdaman ☺️ I've changed the URLs and fixed the code
Thank you! The only other thing I'd suggest is similiar to https://github.com/nuxt-community/feed-module/issues/1 maybe add the axios require line above the usage, e.g.
const axios = require('axios')
const posts = await (axios.get('https://api.blog.lichter.io/posts')).data
That way readers can do a straight copy/paste without needing to find that issue.
Done 👌 Thanks a lot for you suggestions!
Where you have:
Should be:
i.e. extra parens around the await/get so it resolves before you try accessing
.data
(as per other examples below it)