Coder Social home page Coder Social logo

quarkus-api-example's Introduction

Quarkus API example

Contribute Contribute (nightly)

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

Development with Eclipse Che

This project provides a devfile.yaml file that defines the containers required for development, as well as a list of development commands.

To run these commands from VS Code, open the command palette and navigate to Tasks: Run Task > che.

Task Description
Package Runs mvn package.
Run Tests Runs mvn test.
Package Native Runs a Quarkus native build.
Build Image Builds a container image for the Quarkus application running in JVM mode. Package task must be run before this task.
Start Development mode (Hot reload + debug) Runs the Quarkus application in development mode.
Start Native Runs the Quarkus native binary. Package Native task must be run before this task.

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

quarkus-api-example's People

Contributors

ibuziuk avatar dkwon17 avatar svor avatar vinokurig avatar mkuznyetsov avatar vitaliy-guliy avatar sdawley avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.