Hey,
So, I’m currently working on my Portfolio. I use Axios to fetch the Dev.to API to get my latest articles.
On localhost, everything works fine, but with Glitch in prod, I only see one article.
Glitch repo: https://glitch.com/~independence-dev
Here is the code I use, it’s the same on local and on Glitch:
new Vue({
el: "#articles",
data: {
items: []
},
mounted() {
let articlesList = [];
axios
.get("https://dev.to/api/articles?username=icesofty")
.then(function (response) {
response.data.forEach((element) => {
articlesList.push(element);
});
console.log(articlesList);
})
.then(() => {
this.items = articlesList;
})
.catch(function (error) {
console.warn(error);
});
}
});
On localhost, console.log(articlesList); print all my articles, but on Glitch, it only prints one article.
Here is a screenshot of my localhost (on the right) and on Glitch (on the left).
Cheers!
[UPDATE] The changes are visible on my Glitch project, but not on my custom domain https://www.independence.dev/