This project requires a mariadb database to run. This database can be provided by a container. The following instructions will provide a mariadb container with [Podman](https://podman.io/).
Create the database POD.
Note
|
The database port mapping must be the one informe in the application.properties file. |
podman pod create -p 7736:3306 --name quarkus_example_db_pod
podman run --rm --name quarkus_example_db -e MYSQL_ROOT_PASSWORD=quarkus_example -e MYSQL_DATABASE=quarkus_example -e MYSQL_USER=quarkus_example -e MYSQL_PASSWORD=quarkus_example --pod quarkus_example_db_pod mariadb:latest
It is also possible to interact with our REST endpoints with the curl tool, here are some basic commands:
In order to create an Object and persists it in the DB:
curl -i -X POST -H 'Content-Type: application/json' -d '{"name":"banana","description":"is_always_good","family":"palmera","isRipen":"true"}' http://localhost:8080/fruitreact/create
In order to list all the items in the DB:
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://localhost:8080/fruitreact/listAll
In order to list one of the items in the DB:
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://localhost:8080/fruitreact/name/banana
In order to change the ripe status of a family of Fruits:
curl -i -X PUT http://localhost:8080/fruitreact/ripe/palmera
In order to delete a fruit from the DB.
curl -i -X DELETE http://localhost:8080/fruitreact/banana