Build Restful CRUD API for a simple CURD application using Spring Boot, Mysql, JPA and Hibernate.
-
Java - 1.8.x
-
Maven - 3.x.x
-
Mysql - 5.x.x
1. Clone the application
git clone https://github.com/srvinoth/springboot-curd-api.git2. Create Mysql database
create database curd_db3. Change mysql username and password as per your installation
-
open
src/main/resources/application.properties -
change
spring.datasource.usernameandspring.datasource.passwordas per your mysql installation
4. Build and run the app using maven
mvn package
java -jar target/springboot-curd-api-0.0.1.jarAlternatively, you can run the app without packaging it using -
mvn spring-boot:runThe app will start running at http://localhost:8080.
The app defines following CRUD APIs.
GET /api/customer
POST /api/customer
GET /api/customer/{customerId}
PUT /api/customer/{customerId}
DELETE /api/customer/{customerId}
You can test them using postman or any other rest client.