This project provides a simple RESTful API for book management. Users can list books, add new books, update existing books, or delete them.
To run the project, follow these steps:
- Java 8 or above
- Maven
- MySQL
- Postman (optional, can be used to test the API)
Update your database connection details in the application.properties
file:
propertiesCopy code
spring.datasource.username=username
spring.datasource.password=password
spring.datasource.url=jdbc:mysql://localhost:3306/books
Save to grepper
Open a terminal in the project directory and run the following command:
bashCopy code
mvn spring-boot:run
Save to grepper
Once the project is successfully running, you can use the API with Postman or any other REST API testing tool.
- List All Books:
- HTTP Method: GET
- Endpoint:
/api/kitaplar
- Lists all books.
- Get a Specific Book:
- HTTP Method: GET
- Endpoint:
/api/kitaplar/{id}
- Retrieves a specific book by ID.
- Add a New Book:
- HTTP Method: POST
- Endpoint:
/api/kitaplar
- Adds a new book.
- Update a Book:
- HTTP Method: PUT
- Endpoint:
/api/kitaplar/{id}
- Updates an existing book.
- Delete a Book:
- HTTP Method: DELETE
- Endpoint:
/api/kitaplar/{id}
- Deletes an existing book.