This simple Spring Boot project provides a basic API for performing CRUD (Create, Read, Update, Delete) operations on books and authors.
To run the project on your local machine, follow the steps below.
- Java JDK 21
- Maven
-
Navigate to the project directory:
cd book-api-main
-
Build the project:
./mvnw clean install
-
Run the application:
java -jar target/database-0.0.1-SNAPSHOT.jar
The application will run by default at http://localhost:8080
.
Endpoint: GET /books
Lists all books.
Endpoint: GET /authors
Lists all authors.
Endpoint: GET /books/{bookId}
Gets details of a specific book.
Endpoint: GET /authors/{authorId}
Gets details of a specific author.
Endpoint: POST /books
Adds a new book. The request body should contain book details.
Endpoint: POST /authors
Adds a new author. The request body should contain author details.
Endpoint: PUT /books/{bookId}
Updates information for a specific book.
Endpoint: PUT /authors/{authorId}
Updates information for a specific author.
Endpoint: DELETE /books/{bookId}
Deletes a specific book.
Endpoint: DELETE /authors/{authorId}
Deletes a specific author.
- Fork this repository and clone it to your workspace.
- Add new features or fix bugs.
- Commit your changes in a branch:
git commit -m 'Add new feature'
- Synchronize your branch with the main repository:
git push origin my-feature-branch
- Create a Pull Request.