https://github.com/alexandredresch/spring-boot-book-api
This is a sample Spring Boot application that provides a RESTful API for managing book records.
https://github.com/alexandredresch/spring-boot-book-api
java spring-boot
Last synced: 28 days ago
JSON representation
This is a sample Spring Boot application that provides a RESTful API for managing book records.
- Host: GitHub
- URL: https://github.com/alexandredresch/spring-boot-book-api
- Owner: AlexandreDresch
- Created: 2023-08-16T03:12:23.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-08-16T03:18:46.000Z (almost 3 years ago)
- Last Synced: 2025-01-08T09:26:16.238Z (over 1 year ago)
- Topics: java, spring-boot
- Language: Java
- Homepage:
- Size: 64.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Spring Boot Book Management API
This is a sample Spring Boot application that provides a RESTful API for managing book records.
## Getting Started
### Prerequisites
- Java 17 or higher
- Maven
- Your favorite IDE (IntelliJ IDEA, Eclipse, etc.)
### Installation
1. Clone the repository:
```bash
git clone https://github.com/AlexandreDresch/spring-book-book-api.git
cd spring-boot-book-api
```
2. Build the project:
```bash
mvn clean install
```
3. Run the application:
```bash
mvn spring-boot:run
```
### Usage
#### Endpoints
The API provides the following endpoints:
- POST /books: Create a new book record.
- GET /books: Get a list of all books.
- GET /books/{id}: Get details about a specific book.
- PUT /books/{id}: Update details of a specific book.
- DELETE /books/{id}: Delete a specific book.
##### Example Requests
- Create a new book:
```http
POST /books
Content-Type: application/json
{
"name": "Clean Code: A Handbook of Agile Software Craftsmanshipe",
"pages": 431
}
```
- Get all books:
```http
GET /books
```
- Get details about a specific book:
```http
GET /books/{id}
```
- Update details of a specific book:
```http
PUT /books/{id}
Content-Type: application/json
{
"name": "Clean Code: A Handbook of Agile Software Craftsmanshipe",
"pages": 431
}
```
- Delete a specific book:
```http
DELETE /books/{id}
```