Library REST API with ThymeLeaf

preview_player
Показать описание
REST API Project for a Library application, additionally using ThymeLeaf for Web page access

Setup (only once)

Video starting at 01:00 - Create Spring Starter Project
4. Create Spring Starter Project with Type: Maven, Java 17 with dependencies Spring Web, MySQL Driver, JPA, Thymeleaf
5. Allow project components to be downloaded by Spring Boot (Internet required). After 2 min, Project is ready

Video starting at 02:53 - Create Classes and Interface
7. Create Entity class with @Entity, @Table, attributes, methods and constructors
9. Create Repository interface for enabling CRUD (Create, Read, Update, Delete) with Database
10. Create Controller class with @RestController, @PostMapping, @GetMapping and 2 methods
- addBook() method to add a specific book to the database. Data sent as body in JSON format (POST method)
- getAll() method to fetch all the books in the database. No body required. (GET method)

Video at 11:57 - Test REST API using Talent API Tester
12. Run Project and ensure that all errors are fixed
13. Open Talend API Tester and test POST API and GET API

Video at 14:50 - Add Web Interface
17. Open MySQL Workbench and execute SQL query to check contents of the database.
Рекомендации по теме