This example shows a simple REST-API with intern H2 Database access running with Quarkus.
- Quarkus
- Hibernate
- H2 Database
Run ./mvnw clean package
or mvnw.cmd clean package
(Windows) to build this project.
java -jar target/quarkus-rest-example-1.0-runner.jar
Get all contacts
curl -X GET http://localhost:8080/api/contacts
Get single contact
curl -X GET http://localhost:8080/api/contacts/-1
Add contact
curl -X POST -H "Content-Type: application/json" -d '{"companyName":"J+J Doe Inc.","firstName":"Jane","lastName":"Doe"}' http://localhost:8080/api/contacts
Update contact
curl -X PUT -H "Content-Type: application/json" -d '{"companyName":"J+J Doe Inc.","firstName":"Jane Q.","lastName":"Doe"}' http://localhost:8080/api/contacts/1
Delete contact
curl -X DELETE http://localhost:8080/api/contacts/-1