Coder Social home page Coder Social logo

pet-store-api's Introduction

PetStore Application

Introduction

an API implemented to get pets and pet types. This project uses Quarkus, the Supersonic Subatomic Java Framework.

If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ .

Packaging and running the application

If you want to build the java executable, execute the following command:

./gradlew build -Dquarkus.package.type=uber-jar

To run the application:

java -jar build/petstore-runner.jar

The application can be also packaged using simple:

./gradlew build

To launch the test page, open your browser at the following URL

http://localhost:8080/index.html

Running the application in dev mode

You can run your application in dev mode that enables live coding using:

./gradlew quarkusDev

NOTE: Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.

The APIs:

Pets:

  • Get all pets: GET: http://localhost:8080/v1/pets

  • Get a single pet GET: http://localhost:8080/v1/pets/{petId}

  • Add a new pet: POST: http://localhost:8080/v1/pets/

  • Update pet: PUT: http://localhost:8080/v1/pets/

  • Delete pet: DELETE: http://localhost:8080/v1/pets/

Pet Types:

  • Get all pet types: GET: http://localhost:8080/v1/petstype

  • Get the pet type for a pet: GET: http://localhost:8080/v1/petstype/{petId}

  • Add a new pet type: POST: http://localhost:8080/v1/petstype

  • Update pet type: PUT: http://localhost:8080/v1/pets/

  • Delete pet type: DELETE: http://localhost:8080/v1/pets/

Creating a native executable

Mind having GRAALVM_HOME set to your Mandrel or GraalVM installation.

You can create a native executable using:

./gradlew build -Dquarkus.package.type=native

Or, if you don't have Mandrel or GraalVM installed, you can run the native executable build in a container using:

./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true

Health

The health status can be used to determine if the 'computing node' needs to be discarded/restarted or not. Specification here

Metrics

The Metrics exports Telemetric data in a uniform way of system and custom resources. Specification here

The example class MetricController contains an example how you can measure the execution time of a request. The index page also contains a link to the metric page (with all metric info)

JWT Auth

Using the OpenId Connect JWT token to pass authentication and authorization information to the JAX-RS endpoint. Specification here

Open API

Exposes the information about your endpoints in the format of the OpenAPI v3 specification. Specification here

The index page contains a link to the OpenAPI information of your endpoints.

pet-store-api's People

Contributors

ov1n avatar

Watchers

 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.