azatsarynnyy / quarkus-api-example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Quarkus API example

Contribute

Quarkus REST API with Hibernate ORM, Panache, RESTEasy, and PostgreSQL. Requires JDK 11.

NOTE: Perfoming a native Quarkus build with the packagenative command fails on Eclipse Che Hosted by Red Hat due to the 7GB usage limit.

Endpoints

Method Endpoint Description
GET /food Lists all Food resources
GET /food/{id} Retrieves the Food resource with the specified ID
GET /food/search/{name} Retrieves a Food resource with the specified name
GET /food/restaurant/{restaurantName} Lists all Food resources with the specified restaurantName
POST /food Creates a Food resource

Local development

Create PostgresSQL container

docker run -it --rm=true --name food_db -e POSTGRESQL_USER=user -e POSTGRESQL_PASSWORD=password -e POSTGRESQL_DATABASE=food_db -p 5432:5432 quay.io/centos7/postgresql-13-centos7@sha256:994f5c622e2913bda1c4a7fa3b0c7e7f75e7caa3ac66ff1ed70ccfe65c40dd75

Run in development mode

./mvnw compile quarkus:dev

Navigate to localhost:8080/food to view the pre-imported Food resources.

Packaging the application

./mvnw clean package

Run tests only

./mvnw test

Resources

About

License:Eclipse Public License 2.0


Languages

Language:HTML 50.9%Language:Java 49.1%