rest-api-crud-example
This project demonstrates a simple REST API with CRUD (Create, Read, Update, Delete) operations using Java and Spring Boot. It is structured as a Maven project for easy dependency management and build automation.
- RESTful endpoints for CRUD operations
- In-memory database (H2) for development and testing
- Standard Maven project structure
- Java 17 or higher
- Maven 3.9+
- Ensure Path Variables are set properly
-
Clone the repository: go to your windows/unix path where you want to clone the remote project
git clone https://github.com/mahakud1/rest-api-crud-example.git cd rest-api-crud-example -
Build the project:
mvn clean package
-
Run the application:
mvn spring-boot:run
-
Access the API:
- The API will be available at 'http://localhost:8080/swagger-ui/index.html/'
rest-api-crud-example/
├── src/
│ ├── main/
│ │ ├── java/
│ │ └── resources/
│ └── test/
├── pom.xml
└── README.md
| Method | Endpoint | Description |
|---|---|---|
| GET | /entities | List all entities |
| GET | /entities/{id} | Get entity by ID |
| POST | /entities | Create new entity |
| PUT | /entities/{id} | Update entity |
| DELETE | /entities/{id} | Delete entity |
NA