Application runs on port 9090, change port in application.yml file and rebuild the package using maven
Download the 'fat' jar file from here here
and run this jar using following command
java -jar todo-application-0.0.1-SNAPSHOT.jar
or build using maven
mvn clean package
and find the jar in target folder
1. Add new task for a certain date.
2. Get all task for certain date.
3. Get each task individually.
4. Update task.
5. Delete each task.
- Integration with the Spring Boot Framework: inversion of control, dependency injection, etc.
- Writing a RESTful service using annotation: supports JSON request / response; remember to add JSON as desired Accept header in your request
- Spring Data Integration with JPA/Hibernate with just a few lines of configuration and familiar annotations.
- Automatic CRUD functionality against the data source using JPA Repository pattern
POST /todo/task
Accept: application/json
Content-Type: application/json
{
"description" : "text",
"date" : "2017-06-17"
}
RESPONSE: HTTP 201 (Created)
Location header: http://localhost:9090/todo/task/1
curl -d '{"description":"message", "date":"1993-04-15"}' -H "Content-Type: application/json" -X POST http://localhost:9090/todo/task
PUT /todo/task/{id}
Accept: application/json
Content-Type: application/json
{
"id":1,
"description" : "text",
"date" : "2017-06-17"
}
RESPONSE: HTTP 204 (No Content)
curl -d '{"id":1,"description":"text", "date":"2017-06-17"}' -H "Content-Type: application/json" -X PUT http://localhost:9090/todo/task/1
GET /todo/task/{id}
Accept: application/json
Response: 200 (OK)
Content-Type: application/json;charset=UTF-8
{"id":1,"description":"text","date":"2017-06-17"}
curl http://localhost:9090/todo/task/1
GET /todo/task
Accept: application/json
Response: 200 (OK)
Content-Type: application/json;charset=UTF-8
[{"id":1,"description":"text","date":"2017-06-17"}]
curl http://localhost:9090/todo/task
GET /todo/task?date=yyyy-mm-dd
Accept: application/json
Response: 200 (OK)
Content-Type: application/json;charset=UTF-8
[{"id":1,"description":"text","date":"2017-06-17"}]
curl http://localhost:9090/todo/task?date=2017-06-17
DELETE /todo/task/{id}
RESPONSE: HTTP 204 (No Content)
curl -X "DELETE" http://localhost:9090/todo/task/1