Now, let's put the frontend and the backend of the Messages App together. We will populate the messages list in the UI by querying messages from the database and save new messages to the database after clicking the Add
button in the UI.
The following are the things we need to do to make the integration work:
- Place the frontend and backend code in the same project
- Add APIs to the backend for getting messages and saving new messages
- Add the ability to communicate with the backend to the frontend
In Chapter 2, Vue.js 2 - It Works in the Way You Expected, we created the frontend and usedhttp-server
to serve theindex.html
file and the static .js
assets. When the integration is done, the embedded Tomcat server will serve these files. Now, let's move the frontend code to the backend.