This project is a Book Management CRUD application built using Spring Boot that provides a RESTful API to manage books
- Add new books
- View details of existing books
- Update book information
- Delete books
- List all books
It uses the H2 temporary database
- Clone the repository
- Run the project
- Go to 'localhost:9090/h2' for h2 console
- Login using the default user id and password
- Create table Books
- Use Postman to add, view, update or delete books
-
Create a New Book
- URL: /addBook
- Method: POST
- Request Body:
{ "title": "Book Title", "author": "Author Name" }
ID parameter is self-created for all books.
-
Retrieve All Books
- URL: /getAllBooks
- Method: GET
-
Retrieve a single book by ID
- URL: /getBookById/{id}
- Method: GET
-
Update an existing book by ID
- URL: /updateBookById/{id}
- Method: POST
- Request Body:
{ "title": "Updated Book Title", "author": "Updated Author Name" }
-
Delete a Book
- URL: /deleteBookById/{id}
- Method: DELETE