Installing the Axios library
We see that, for now, we can manipulate the list items displayed on the HTML page, but we cannot yet update them in the database on the server.
For this, the Vue.js program must be able to communicate with the Node.js server. This is possible using a JavaScript library such as Axios (see https://github.com/axios/axios). All you have to do is include the library in the HTML page (here, it will be in the index.html
file) in order to be able to use its features.
Note
The Axios library is a library allowing communication between a browser and a server using Ajax technology. This technology allows a browser and a server to exchange information while remaining on the same HTML page, which is what we want here. This is called a single-page application (SPA) (when the application consists of a single HTML page).
Let’s include the Axios library in the index.html
file (using the <script>
tag), and display the value of the axios.VERSION
variable...