- Clone this repository:
git clone https://github.com/hendisantika/student-crud-app.git
- Navigate to the folder:
cd student-crud-app
- Change your MySQL Credentials with your own in application.properties
- Run the application:
mvn clean spring-boot:run
- Import the POSTMAN Collection.
Add New Student
curl --location --request POST 'localhost:8080/api/students' \
--header 'Content-Type: application/json' \
--data-raw '{
"firstName" : "Uzumaki",
"lastName": "Naruto",
"email": "uzumaki_naruto@konohagakure.co.jp",
"phone": "+6281321411511"
}'
Get All Students
curl --location --request GET 'localhost:8080/api/students'
Update Student
curl --location --request PUT 'localhost:8080/api/students/1' \
--header 'Content-Type: application/json' \
--data-raw '{
"firstName" : "Uzumaki",
"lastName": "Naruto Hokage",
"email": "uzumaki_naruto@konohagakure.co.jp",
"phone": "+6281321411511"
}'
Find Student by ID
curl --location --request GET 'localhost:8080/api/students/1'
Delete Student
curl --location --request DELETE 'localhost:8080/api/students/4'