Skip to content

extact-io/codespaces-sample

Repository files navigation

helidon-quickstart-mp

Minimal Helidon MP project suitable to start from scratch.

Build and run

With JDK17+

mvn package
java -jar target/helidon-quickstart-mp.jar

Exercise the application

curl -X GET http://localhost:8080/simple-greet
{"message":"Hello World!"}
curl -X GET http://localhost:8080/greet
{"message":"Hello World!"}

curl -X GET http://localhost:8080/greet/Joe
{"message":"Hello Joe!"}

curl -X PUT -H "Content-Type: application/json" -d '{"greeting" : "Hola"}' http://localhost:8080/greet/greeting

curl -X GET http://localhost:8080/greet/Jose
{"message":"Hola Jose!"}

Try metrics

# Prometheus Format
curl -s -X GET http://localhost:8080/metrics
# TYPE base:gc_g1_young_generation_count gauge
. . .

# JSON Format
curl -H 'Accept: application/json' -X GET http://localhost:8080/metrics
{"base":...
. . .

Try health

curl -s -X GET http://localhost:8080/health
{"outcome":"UP",...

Building the Docker Image

docker build -t helidon-quickstart-mp .

Running the Docker Image

docker run --rm -p 8080:8080 helidon-quickstart-mp:latest

Exercise the application as described above.

Building a Custom Runtime Image

Build the custom runtime image using the jlink image profile:

mvn package -Pjlink-image

This uses the helidon-maven-plugin to perform the custom image generation. After the build completes it will report some statistics about the build including the reduction in image size.

The target/helidon-quickstart-mp-jri directory is a self contained custom image of your application. It contains your application, its runtime dependencies and the JDK modules it depends on. You can start your application using the provide start script:

./target/helidon-quickstart-mp-jri/bin/start

About

this repository is for trying out GitHub codespaces

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published