This is a sample java CRUD application built on top of Spring Boot.
mvn clean verify -Dskip.integration.tests=false -Dmaven.test.failure.ignore=false
The application is expecting a running PostgreSQL database. Connection strings can be defined in application.properties
as usual.
SQL script for creating the database can be found in src/main/resources/create_db.sql
java -jar target/homework-0.0.1-SNAPSHOT.jar
Note: Currently the embedded tomcat server is connecting to a database that is running on my home server
The server is listening on port 8080 by default.
Fetch All Machines
URL: http://localhost:8080/api/machines
Request Verb: GET
Request Body: [empty]
Response Body: [empty]
Fetch a single Machine
URL: http://localhost:8080/api/machines/{id}
Request Verb: GET
Request Body: [empty]
Response Body:
{
"id": "10112233-4455-6677-8899-aabbccddeeff",
"name": "Test 1",
"createdAt": "2020-09-23T22:38:00"
}
Create Machine
URL: http://localhost:8080/api/machines/{id}
Request Verb: POST
Request Body:
{
"name": "Test 1"
}
Response Body:
{
"id": "a2370f6e-0d0b-457c-a15f-12dd4ff11aa1",
"name": "Test 1",
"createdAt": "2020-09-26T02:05:41.3623474"
}
Update Machine
URL: http://localhost:8080/api/machines/{id}
Request Verb: PUT
Request Body:
{
"id": "a2370f6e-0d0b-457c-a15f-12dd4ff11aa1",
"name": "Renamed Test 1"
}
Response Body:
{
"id": "a2370f6e-0d0b-457c-a15f-12dd4ff11aa1",
"name": "Renamed Test 1",
"createdAt": "2020-09-26T02:05:41.3623474"
}
Delete Machine
URL: http://localhost:8080/api/machines/{id}
Request Verb: DELETE
Request Body: [empty]
Response Body: [empty]
- Configure logging as desired
- Configure Deployment as desired (Tomcat Dedicated? Docker?)
- Configure proper database
- Add Continuus Integration on Github