Full-Stack Web Development with Vue.js and Node

(singke) #1
Building the Real Application Chapter 5

url: 'http://localhost:8081/movies',
})
.then((response) => {
this.movies = response.data.movies;
})
.catch(() => {
});
},
},
};
</script>

This code calls a method when the page loads, which is defined in the mounted method.


The method fetches the movies using an axios request. Now we have pulled the data from
the server to the client. Now, we will use the vue directive to loop through these movies


and render in the home page. Replace the content of the