This Spring Boot application provides some of the CRUD (Create, Read, Update, Delete) operations for a Book entity.
- Retrieves a book by its ID.
- Retrieves all books.
- Saves a list of books.
- GET /books/{id}: Retrieves a Book by its ID. If no Book is found, a custom RunTime Exception is handled and a meaningful error message is returned.
- GET /books: Retrieves all Books.
- POST /books: Saves new Books. The request body should be in JSON format, for example, refer to sample.json.
To run this project locally, you need to have Java and Maven installed on your machine. You also need to have a PostgreSQL database set up.
- Clone the repository
- Navigate to the project directory
- Update the database configuration in
application.propertiesfile: - Run
mvn spring-boot:runto start the application - Access the application at
http://localhost:9000( port as mentioned inapplication.propertiesusingserver.portproperty )
- Spring Boot
- Spring Boot Web
- Spring Boot Data JPA
- PostgreSQL JDBC Driver
- Mayank Sahu (https://github.com/mayank19o7).