Build Restful CRUD API for a simple Book-Manage application using Spring MVC, Mysql and Hibernate.
Java - 1.8.x
Maven - 3.6.0
MySQL - 8.0.2
git clone https://github.com/RocktimRajkumar/Book-API.git
create database bookapi
open src/main/resources/db.properties
change mysql.user and mysql.password as per your mysql installation
mvn package
A new WAR file will be generated at project/target/BookAPI.war, just copy and deploy to your Tomcat.
The app will start running at http://localhost:8080/BookAPI/api/book/.
The app defines following CRUD APIs.
HTTP Method | CRUD Operation | Description |
---|---|---|
POST | Create | Create a new Book https://localhost:8080/BookAPI/api/book |
GET | Read | Retrieve a Single Book/All Books https://localhost:8080/BookAPI/api/book https://localhost:8080/BookAPI/api/book/{id} |
PUT | Update | Update or modify a Book https://localhost:8080/BookAPI/api/book/{id} |
DELETE | Delete | Delete a Book :- https://localhost:8080/BookAPI/api/book/{id} |
You can test them using postman or any other rest client.