GithubHelp home page GithubHelp logo

pallabchow / apollo-missions-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from isaaceindhoven/apollo-missions-api

0.0 0.0 0.0 63 KB

Apollo Missions REST API is a sample Java REST API to be used within the ISAAC Developer Blog posts.

Shell 0.53% Java 99.47%

apollo-missions-api's Introduction

Apollo Missions REST API

This REST API provides some basic data about the Apollo missions. It is meant as a sample Java REST API to be used within the ISAAC Developer Blog posts.

Endpoints regarding the Apollo Missions:

  1. /missions/manned
  2. /missions/manned/{missionId}

Endpoints that can be used when experimenting with AWS EC2 Auto Scaling Service and using Elastic Load Balancing Service:

  1. /longComputation
  2. /health

Requirements

To compile and run this application you will need:

  • JDK 1.8+
  • GraalVM (if you intend to make a native executable)

Configuring JDK 1.8+

Make sure that the JAVA_HOME environment variable has been set, and that a JDK 1.8+ java command is on the path.

Configuring GraalVM

Make sure that the GRAALVM_HOME environment variable has been set.

See the Building a Native Executable guide for help setting up your environment.

Building the application

Launch the Maven build on the checked out sources of this application:

./mvnw package

Live coding with Quarkus

The Maven Quarkus plugin provides a development mode that supports live coding. To try this out:

./mvnw quarkus:dev

This command will leave Quarkus running in the foreground listening on port 8080. Append the endpoints to the base URL http://127.0.0.1:8080.

Run Quarkus in JVM mode

When you're done iterating in developer mode, you can run the application as a conventional jar file.

First compile it:

./mvnw package

Then run it:

java -jar ./target/apollo-missions-api-1.0.0-runner.jar

Run Quarkus as a native executable

You can also create a native executable from this application without making any source code changes. A native executable removes the dependency on the JVM: everything needed to run the application on the target platform is included in the executable, allowing the application to run with minimal resource overhead.

Compiling a native executable takes a bit longer, as GraalVM performs additional steps to remove unnecessary codepaths. Use the native profile to compile a native executable:

./mvnw package -Dnative

After the compilation is done, you'll be able to run this executable directly:

./target/apollo-missions-api-1.0.0-runner

Run Quarkus in JVM mode in a docker container

First compile it:

./mvnw package

Then, build the image with:

docker build -f src/main/docker/Dockerfile.jvm -t isaacdeveloperblog/apollo-missions-api:1.0.0 .

Then run the container using:

docker run -i --rm -p 8080:8080 isaacdeveloperblog/apollo-missions-api:1.0.0

Run Quarkus as a native executable in a docker container

First compile it:

./mvnw package -Pnative -Dquarkus.native.container-build=true

Then, build the image with:

docker build -f src/main/docker/Dockerfile.native -t isaacdeveloperblog/apollo-missions-api-native:1.0.0 .

Then run the container using:

docker run -i --rm -p 8080:8080 isaacdeveloperblog/apollo-missions-api-native:1.0.0

apollo-missions-api's People

Contributors

paulminasian 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.