From 4efab4d06d080cd818324396c84c07db480d02d1 Mon Sep 17 00:00:00 2001 From: Maxim Nesen Date: Wed, 4 Oct 2023 17:12:03 +0200 Subject: [PATCH] README.md corrections (#21) * README.md corrections Signed-off-by: Maxim Nesen --- examples/integrations/cdi/pokemons/README.md | 2 +- examples/integrations/micrometer/mp/README.md | 2 +- examples/integrations/micrometer/se/README.md | 6 +-- examples/jbatch/README.md | 2 +- examples/logging/logback-aot/README.md | 4 +- examples/logging/slf4j/README.md | 4 +- examples/media/multipart/README.md | 2 +- examples/messaging/kafkaConsume.sh | 0 examples/messaging/kafkaProduce.sh | 0 examples/messaging/kafkaRun.sh | 0 examples/metrics/filtering/mp/README.md | 46 +++++++++++++++++++ examples/metrics/filtering/se/README.md | 46 +++++++++++++++++++ .../metrics/http-status-count-se/README.md | 2 +- .../microprofile/bean-validation/README.md | 27 ++++++----- examples/microprofile/cors/README.md | 4 +- .../hello-world-explicit/README.md | 6 +-- .../http-status-count-mp/README.md | 2 +- examples/microprofile/oidc/README.md | 2 + examples/microprofile/openapi-basic/README.md | 2 +- examples/microprofile/openapi-basic/pom.xml | 4 ++ .../quickstart-mp/mp-client/README.md | 12 +++-- .../quickstart-mp/mp-server/README.md | 9 ++-- .../quickstart-se/se-server/README.md | 2 +- .../helidon-quickstart-mp/README.md | 2 +- .../README.md | 2 +- .../basic-auth-with-static-content/README.md | 14 +++--- .../security/webserver-digest-auth/README.md | 12 ++--- examples/webserver/fault-tolerance/README.md | 19 ++++++++ examples/webserver/tls/README.md | 24 ++++++++++ .../helidon/webserver/examples/tls/Main.java | 2 +- examples/webserver/tutorial/README.md | 6 +++ 31 files changed, 212 insertions(+), 55 deletions(-) mode change 100644 => 100755 examples/messaging/kafkaConsume.sh mode change 100644 => 100755 examples/messaging/kafkaProduce.sh mode change 100644 => 100755 examples/messaging/kafkaRun.sh create mode 100644 examples/metrics/filtering/mp/README.md create mode 100644 examples/metrics/filtering/se/README.md create mode 100644 examples/webserver/fault-tolerance/README.md create mode 100644 examples/webserver/tls/README.md diff --git a/examples/integrations/cdi/pokemons/README.md b/examples/integrations/cdi/pokemons/README.md index 513acbfb..77dff66a 100644 --- a/examples/integrations/cdi/pokemons/README.md +++ b/examples/integrations/cdi/pokemons/README.md @@ -3,7 +3,7 @@ With Java: ```bash mvn package -java -jar target/helidon-integrations-examples-pokemons-jpa.jar +java -jar target/helidon-integrations-examples-pokemons.jar ``` ## Exercise the application diff --git a/examples/integrations/micrometer/mp/README.md b/examples/integrations/micrometer/mp/README.md index d185c870..53660633 100644 --- a/examples/integrations/micrometer/mp/README.md +++ b/examples/integrations/micrometer/mp/README.md @@ -39,7 +39,7 @@ curl -X GET http://localhost:8080/greet 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 PUT -H "Content-Type: application/json" -d '{"message" : "Hola"}' http://localhost:8080/greet/greeting curl -X GET http://localhost:8080/greet/Jose {"message":"Hola Jose!"} diff --git a/examples/integrations/micrometer/se/README.md b/examples/integrations/micrometer/se/README.md index aecdb160..1a316861 100644 --- a/examples/integrations/micrometer/se/README.md +++ b/examples/integrations/micrometer/se/README.md @@ -45,15 +45,15 @@ java -jar target/helidon-examples-integrations-micrometer-se.jar These normal greeting app endpoints work just as in the original greeting app: ```bash -curl -X GET http://localhost:8080/greet +curl -X GET http://localhost:[PORT]/greet {"message":"Hello World!"} -curl -X GET http://localhost:8080/greet/Joe +curl -X GET http://localhost:[PORT]/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 +curl -X GET http://localhost:[PORT]/greet/Jose {"message":"Hola Jose!"} ``` diff --git a/examples/jbatch/README.md b/examples/jbatch/README.md index 94539834..3153e004 100644 --- a/examples/jbatch/README.md +++ b/examples/jbatch/README.md @@ -7,7 +7,7 @@ Minimal Helidon MP + jBatch PoC. With JDK11+ ```bash mvn package -java -jar target/helidon-jbatch-example.jar +java -jar target/helidon-example-jbatch.jar ``` ## Exercise the application diff --git a/examples/logging/logback-aot/README.md b/examples/logging/logback-aot/README.md index ccce32d5..4cf31152 100644 --- a/examples/logging/logback-aot/README.md +++ b/examples/logging/logback-aot/README.md @@ -36,7 +36,7 @@ mvn clean package Run from command line: ```shell script -java -jar target/helidon-examples-logging-sfl4j.jar +java -jar target/helidon-examples-logging-slf4j-aot.jar ``` Execute endpoint: @@ -56,5 +56,5 @@ mvn clean package -Pnative-image Run from command line: ```shell script -./target/helidon-examples-logging-sfl4j +./target/helidon-examples-logging-slf4j-aot ``` diff --git a/examples/logging/slf4j/README.md b/examples/logging/slf4j/README.md index 3f5fae5a..df4d3826 100644 --- a/examples/logging/slf4j/README.md +++ b/examples/logging/slf4j/README.md @@ -26,7 +26,7 @@ mvn clean package Run from command line: ```shell script -java -jar target/helidon-examples-logging-sfl4j.jar +java -jar target/helidon-examples-logging-slf4j.jar ``` # Running as native image @@ -41,5 +41,5 @@ mvn clean package -Pnative-image Run from command line: ```shell script -./target/helidon-examples-logging-sfl4j +./target/helidon-examples-logging-slf4j ``` diff --git a/examples/media/multipart/README.md b/examples/media/multipart/README.md index cbe0e9fb..206a630c 100644 --- a/examples/media/multipart/README.md +++ b/examples/media/multipart/README.md @@ -17,7 +17,7 @@ mvn package First, start the server: ``` -java -jar target/helidon-examples-microprofile-multipart.jar +java -jar target/helidon-examples-media-multipart.jar ``` Then open in your browser. diff --git a/examples/messaging/kafkaConsume.sh b/examples/messaging/kafkaConsume.sh old mode 100644 new mode 100755 diff --git a/examples/messaging/kafkaProduce.sh b/examples/messaging/kafkaProduce.sh old mode 100644 new mode 100755 diff --git a/examples/messaging/kafkaRun.sh b/examples/messaging/kafkaRun.sh old mode 100644 new mode 100755 diff --git a/examples/metrics/filtering/mp/README.md b/examples/metrics/filtering/mp/README.md new file mode 100644 index 00000000..78ce08a3 --- /dev/null +++ b/examples/metrics/filtering/mp/README.md @@ -0,0 +1,46 @@ +# Helidon Metrics Filtering MP Example + +This project implements a simple Hello World REST service using Helidon SE and demonstrates the +optional metrics exemplar support. + +## Build and run + +With JDK11+ +```bash +mvn package +java -jar target/helidon-examples-metrics-filtering-mp.jar +``` + +## Exercise the application + +``` +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 '{"message" : "Hola"}' http://localhost:8080/greet/greeting + +curl -X GET http://localhost:8080/greet/Jose +{"message":"Hola Jose!"} + +curl -X GET http://localhost:8080/greet +{"message":"Hola World!"} +``` + +## Retrieve application metrics + +``` +# Prometheus format with exemplars + +curl -s -X GET http://localhost:8080/metrics/application +# TYPE application_counterForPersonalizedGreetings_total counter +# HELP application_counterForPersonalizedGreetings_total +application_counterForPersonalizedGreetings_total 2 # {trace_id="78e61eed351f4c9d"} 1 1617812495.016000 +. . . +# TYPE application_timerForGets_mean_seconds gauge +application_timerForGets_mean_seconds 0.005772598385062112 # {trace_id="b22f13c37ba8b879"} 0.001563945 1617812578.687000 +# TYPE application_timerForGets_max_seconds gauge +application_timerForGets_max_seconds 0.028018165 # {trace_id="a1b127002725143c"} 0.028018165 1617812467.524000 +``` diff --git a/examples/metrics/filtering/se/README.md b/examples/metrics/filtering/se/README.md new file mode 100644 index 00000000..05ace377 --- /dev/null +++ b/examples/metrics/filtering/se/README.md @@ -0,0 +1,46 @@ +# Helidon Filtering Metrics SE Example + +This project implements a simple Hello World REST service using Helidon SE and demonstrates the +optional metrics exemplar support. + +## Build and run + +With JDK11+ +```bash +mvn package +java -jar target/helidon-examples-metrics-se.jar +``` + +## Exercise the application + +``` +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!"} + +curl -X GET http://localhost:8080/greet +{"message":"Hola World!"} +``` + +## Retrieve application metrics + +``` +# Prometheus format with exemplars + +curl -s -X GET http://localhost:8080/metrics/application +# TYPE application_counterForPersonalizedGreetings_total counter +# HELP application_counterForPersonalizedGreetings_total +application_counterForPersonalizedGreetings_total 2 # {trace_id="78e61eed351f4c9d"} 1 1617812495.016000 +. . . +# TYPE application_timerForGets_mean_seconds gauge +application_timerForGets_mean_seconds 0.005772598385062112 # {trace_id="b22f13c37ba8b879"} 0.001563945 1617812578.687000 +# TYPE application_timerForGets_max_seconds gauge +application_timerForGets_max_seconds 0.028018165 # {trace_id="a1b127002725143c"} 0.028018165 1617812467.524000 +``` \ No newline at end of file diff --git a/examples/metrics/http-status-count-se/README.md b/examples/metrics/http-status-count-se/README.md index 6eff1943..94407219 100644 --- a/examples/metrics/http-status-count-se/README.md +++ b/examples/metrics/http-status-count-se/README.md @@ -97,6 +97,6 @@ curl -H "Accept: application/json" -X GET http://localhost:8080/metrics curl -s -X GET http://localhost:8080/health ``` ```listing -{"outcome":"UP",... +{"status":"UP",.... ``` diff --git a/examples/microprofile/bean-validation/README.md b/examples/microprofile/bean-validation/README.md index d21981cd..9c6734cb 100644 --- a/examples/microprofile/bean-validation/README.md +++ b/examples/microprofile/bean-validation/README.md @@ -24,16 +24,21 @@ java -jar target/helidon-examples-microprofile-bean-validation.jar ## Exercise the application ``` -curl -X GET http://localhost:8080/greet -{"message":"Hello World!"} - -curl -X GET -I http://localhost:8080/greet/null - - -HTTP/1.1 400 Bad Request -Content-Type: application/json -transfer-encoding: chunked -connection: keep-alive - +curl -X GET http://localhost:8080/valid/ +{"message":"Valid !"} + +curl -X GET -I http://localhost:8080/valid/null + + +1 constraint violation(s) occurred during method validation. +Constructor or Method: public jakarta.json.JsonObject io.helidon.examples.microprofile.bean.validation.ValidEmailResource.getMessage(java.lang.String) +Argument values: [null] +Constraint violations: + (1) Kind: PARAMETER + parameter index: 0 + message: must be a well-formed email address + root bean: io.helidon.examples.microprofile.bean.validation.ValidEmailResource$Proxy$_$$_WeldSubclass@58f396f6 + property path: getMessage.arg0 + constraint: @jakarta.validation.constraints.Email(flags={}, groups={}, regexp=".*", message="{jakarta.validation.constraints.Email.message}", payload={}) ``` \ No newline at end of file diff --git a/examples/microprofile/cors/README.md b/examples/microprofile/cors/README.md index 5f665c8c..eeb188f5 100644 --- a/examples/microprofile/cors/README.md +++ b/examples/microprofile/cors/README.md @@ -25,7 +25,7 @@ curl -X GET http://localhost:8080/greet 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 PUT -H "Content-Type: application/json" -d '{"message" : "Hola"}' http://localhost:8080/greet/greeting curl -X GET http://localhost:8080/greet/Jose {"message":"Hola Jose!"} @@ -107,7 +107,7 @@ curl -i -X PUT \ -H "Access-Control-Allow-Methods: PUT" \ -H "Access-Control-Allow-Origin: http://foo.com" \ -H "Content-Type: application/json" \ - -d "{ \"greeting\" : \"Cheers\" }" \ + -d "{ \"message\" : \"Cheers\" }" \ http://localhost:8080/greet/greeting HTTP/1.1 204 No Content diff --git a/examples/microprofile/hello-world-explicit/README.md b/examples/microprofile/hello-world-explicit/README.md index 837350fe..8ab9bac0 100644 --- a/examples/microprofile/hello-world-explicit/README.md +++ b/examples/microprofile/hello-world-explicit/README.md @@ -12,9 +12,9 @@ java -jar target/helidon-examples-microprofile-hello-world-explicit.jar Then try the endpoints: ``` -curl -X GET http://localhost:7001/helloworld -curl -X GET http://localhost:7001/helloworld/earth +curl -X GET http://localhost:[PORT]/helloworld +curl -X GET http://localhost:[PORT]/helloworld/earth ``` -By default the server will use a dynamic port, see the messages displayed +By default, the server will use a dynamic port, see the messages displayed when the application starts. diff --git a/examples/microprofile/http-status-count-mp/README.md b/examples/microprofile/http-status-count-mp/README.md index 0e574905..807d6fdf 100644 --- a/examples/microprofile/http-status-count-mp/README.md +++ b/examples/microprofile/http-status-count-mp/README.md @@ -37,7 +37,7 @@ curl -X GET http://localhost:8080/greet/Joe {"message":"Hello Joe!"} ``` ```bash -curl -X PUT -H "Content-Type: application/json" -d '{"greeting" : "Hola"}' http://localhost:8080/greet/greeting +curl -X PUT -H "Content-Type: application/json" -d '{"message" : "Hola"}' http://localhost:8080/greet/greeting curl -X GET http://localhost:8080/greet/Jose ``` diff --git a/examples/microprofile/oidc/README.md b/examples/microprofile/oidc/README.md index 80f82b7f..67d5ca0a 100644 --- a/examples/microprofile/oidc/README.md +++ b/examples/microprofile/oidc/README.md @@ -25,3 +25,5 @@ in `application.yaml`. mvn package java -jar target/helidon-examples-microprofile-security-oidc-login.jar ``` + +Then open http://localhost:7987/test in the browser \ No newline at end of file diff --git a/examples/microprofile/openapi-basic/README.md b/examples/microprofile/openapi-basic/README.md index b44070fc..c3b4fd8b 100644 --- a/examples/microprofile/openapi-basic/README.md +++ b/examples/microprofile/openapi-basic/README.md @@ -19,7 +19,7 @@ curl -X GET http://localhost:8080/greet 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 PUT -H "Content-Type: application/json" -d '{"message" : "Hola"}' http://localhost:8080/greet/greeting curl -X GET http://localhost:8080/greet/Jose {"message":"Hola Jose!"} diff --git a/examples/microprofile/openapi-basic/pom.xml b/examples/microprofile/openapi-basic/pom.xml index 1e96c1ee..e5c2c7bd 100644 --- a/examples/microprofile/openapi-basic/pom.xml +++ b/examples/microprofile/openapi-basic/pom.xml @@ -50,6 +50,10 @@ jersey-media-json-binding runtime + + com.fasterxml.jackson.core + jackson-databind + org.jboss jandex diff --git a/examples/openapi-tools/quickstart-mp/mp-client/README.md b/examples/openapi-tools/quickstart-mp/mp-client/README.md index 43e75a89..1a357667 100644 --- a/examples/openapi-tools/quickstart-mp/mp-client/README.md +++ b/examples/openapi-tools/quickstart-mp/mp-client/README.md @@ -1,7 +1,11 @@ -# OpenAPI Helidon Quickstart +# Helidon Client with OpenAPI -This is a sample for Helidon Quickstart project. +## Build and run +With JDK11+ +```bash +mvn package +java -jar target/openapi-mp-client.jar +``` -## Overview -This project was generated using the Helidon OpenAPI Generator. + diff --git a/examples/openapi-tools/quickstart-mp/mp-server/README.md b/examples/openapi-tools/quickstart-mp/mp-server/README.md index cfe0795d..a541c192 100644 --- a/examples/openapi-tools/quickstart-mp/mp-server/README.md +++ b/examples/openapi-tools/quickstart-mp/mp-server/README.md @@ -5,15 +5,16 @@ With JDK11+ ```bash mvn package -java -jar target/openapi-java-server.jar +java -jar target/openapi-mp-server.jar ``` ## Exercise the application ``` -curl -X GET http://localhost:8080 -curl -X GET http://localhost:8080/{name} -curl -X PUT http://localhost:8080/greeting +curl -X GET http://localhost:8080/greet +curl -X GET http://localhost:8080/greet/{name} +curl -X PUT http://localhost:8080/greet/greeting +curl -X PUT -H "Content-Type: application/json" -d '{"greeting" : "Morning"}' http://localhost:8080/greet/greeting ``` diff --git a/examples/openapi-tools/quickstart-se/se-server/README.md b/examples/openapi-tools/quickstart-se/se-server/README.md index d690bd60..688b55ec 100644 --- a/examples/openapi-tools/quickstart-se/se-server/README.md +++ b/examples/openapi-tools/quickstart-se/se-server/README.md @@ -14,7 +14,7 @@ java -jar target/openapi-java-server.jar curl -X GET http://localhost:8080/greet curl -X GET http://localhost:8080/greet/{name} curl -X PUT http://localhost:8080/greet/greeting - +curl -X PUT -H "Content-Type: application/json" -d '{"greeting" : "Morning"}' http://localhost:8080/greet/greeting ``` ## Try health and metrics diff --git a/examples/quickstarts/helidon-quickstart-mp/README.md b/examples/quickstarts/helidon-quickstart-mp/README.md index 4a025bd5..45297d27 100644 --- a/examples/quickstarts/helidon-quickstart-mp/README.md +++ b/examples/quickstarts/helidon-quickstart-mp/README.md @@ -19,7 +19,7 @@ curl -X GET http://localhost:8080/greet 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 PUT -H "Content-Type: application/json" -d '{"message" : "Hola"}' http://localhost:8080/greet/greeting curl -X GET http://localhost:8080/greet/Jose {"message":"Hola Jose!"} diff --git a/examples/quickstarts/helidon-standalone-quickstart-mp/README.md b/examples/quickstarts/helidon-standalone-quickstart-mp/README.md index 544e5b9a..ef863b8b 100644 --- a/examples/quickstarts/helidon-standalone-quickstart-mp/README.md +++ b/examples/quickstarts/helidon-standalone-quickstart-mp/README.md @@ -20,7 +20,7 @@ curl -X GET http://localhost:8080/greet 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 PUT -H "Content-Type: application/json" -d '{"message" : "Hola"}' http://localhost:8080/greet/greeting curl -X GET http://localhost:8080/greet/Jose {"message":"Hola Jose!"} diff --git a/examples/security/basic-auth-with-static-content/README.md b/examples/security/basic-auth-with-static-content/README.md index 6245dd6c..13277500 100644 --- a/examples/security/basic-auth-with-static-content/README.md +++ b/examples/security/basic-auth-with-static-content/README.md @@ -15,17 +15,17 @@ There are two examples with exactly the same behavior: ```bash mvn package -java -jar target/helidon-examples-security-webserver-basic-auth.jar +java -jar target/helidon-examples-security-webserver-basic-uath.jar ``` Try the application: The application starts on a random port, the following assumes it is `56551` ```bash -curl http://localhost:56551/public -curl -u "jill:password" http://localhost:56551/noRoles -curl -u "john:password" http://localhost:56551/user -curl -u "jack:password" http://localhost:56551/admin -curl -v -u "john:password" http://localhost:56551/deny -curl -u "jack:password" http://localhost:56551/noAuthn +curl http://localhost:[PORT]/public +curl -u "jill:password" http://localhost:[PORT]/noRoles +curl -u "john:password" http://localhost:[PORT]/user +curl -u "jack:password" http://localhost:[PORT]/admin +curl -v -u "john:password" http://localhost:[PORT]/deny +curl -u "jack:password" http://localhost:[PORT]/noAuthn ``` diff --git a/examples/security/webserver-digest-auth/README.md b/examples/security/webserver-digest-auth/README.md index 21791c2d..8741d43a 100644 --- a/examples/security/webserver-digest-auth/README.md +++ b/examples/security/webserver-digest-auth/README.md @@ -21,10 +21,10 @@ Try the application: The application starts on a random port, the following assumes it is `56551` ```bash -curl http://localhost:56551/public -curl --digest -u "jill:password" http://localhost:56551/noRoles -curl --digest -u "john:password" http://localhost:56551/user -curl --digest -u "jack:password" http://localhost:56551/admin -curl -v --digest -u "john:password" http://localhost:56551/deny -curl --digest -u "jack:password" http://localhost:56551/noAuthn +curl http://localhost:[PORT]/public +curl --digest -u "jill:password" http://localhost:[PORT]/noRoles +curl --digest -u "john:password" http://localhost:[PORT]/user +curl --digest -u "jack:password" http://localhost:[PORT]/admin +curl -v --digest -u "john:password" http://localhost:[PORT]/deny +curl --digest -u "jack:password" http://localhost:[PORT]/noAuthn ``` diff --git a/examples/webserver/fault-tolerance/README.md b/examples/webserver/fault-tolerance/README.md new file mode 100644 index 00000000..ab843858 --- /dev/null +++ b/examples/webserver/fault-tolerance/README.md @@ -0,0 +1,19 @@ +# Comments As a Service + +This application runs fault tolerance service on port 8079. + +## Build and run + +```bash +mvn package +java -jar target/helidon-examples-webserver-fault-tolerance.jar +``` + +The output will be like: + +```bash +[Wed Sep 26 16:01:16 CEST 2023] INFO: io.helidon.common.LogConfig doConfigureLogging - Logging at initialization configured using classpath: /logging.properties +[Wed Sep 26 16:01:17 CEST 2023] INFO: io.helidon.common.HelidonFeatures features - Helidon SE 3.2.3-SNAPSHOT features: [Config, Fault Tolerance, Tracing, WebServer] +[Wed Sep 26 16:01:17 CEST 2023] INFO: io.helidon.webserver.NettyWebServer lambda$start$9 - Channel '@default' started: [id: 0xb11f6086, L:/[0:0:0:0:0:0:0:0]:8079] +Server started on http://localhost:8079 +``` diff --git a/examples/webserver/tls/README.md b/examples/webserver/tls/README.md new file mode 100644 index 00000000..27ac6f07 --- /dev/null +++ b/examples/webserver/tls/README.md @@ -0,0 +1,24 @@ +# Comments As a Service + +This application starts a web server with TLS support on the port 8081. + +## Build and run + +```bash +mvn package +java -jar target/helidon-examples-webserver-tls.jar +``` + +The output will be like: + +```bash +[Wed Sep 27 16:11:25 CEST 2023] INFO: io.helidon.common.LogConfig doConfigureLogging - Logging at initialization configured using classpath: /logging.properties +[Wed Sep 27 16:11:25 CEST 2023] INFO: io.helidon.common.HelidonFeatures features - Helidon SE 3.2.3-SNAPSHOT features: [Config, Tracing, WebServer] +[Wed Sep 27 16:11:25 CEST 2023] INFO: io.helidon.webserver.NettyWebServer lambda$start$9 - Channel '@default' started: [id: 0xb28f94e2, L:/[0:0:0:0:0:0:0:0]:8080] with TLS +Started config based WebServer on http://localhost:8080 +[Wed Sep 27 16:11:25 CEST 2023] INFO: io.helidon.webserver.NettyWebServer lambda$start$9 - Channel '@default' started: [id: 0x8aed396c, L:/[0:0:0:0:0:0:0:0]:8081] with TLS +Started builder based WebServer on https://localhost:8081 +``` + +The http://localhost:8080 displays static content (in browser) and https://localhost:8081 displays 'Hello!' after accepting +invalid certificate (in browser) diff --git a/examples/webserver/tls/src/main/java/io/helidon/webserver/examples/tls/Main.java b/examples/webserver/tls/src/main/java/io/helidon/webserver/examples/tls/Main.java index d09aa0b7..e64f9aa5 100644 --- a/examples/webserver/tls/src/main/java/io/helidon/webserver/examples/tls/Main.java +++ b/examples/webserver/tls/src/main/java/io/helidon/webserver/examples/tls/Main.java @@ -51,7 +51,7 @@ public static void main(String[] args) { }); startBuilderBasedServer(config.get("builder-based")) .thenAccept(ws -> { - System.out.println("Started builder based WebServer on http://localhost:" + ws.port()); + System.out.println("Started builder based WebServer on https://localhost:" + ws.port()); }); } diff --git a/examples/webserver/tutorial/README.md b/examples/webserver/tutorial/README.md index fcf0820d..6966c171 100644 --- a/examples/webserver/tutorial/README.md +++ b/examples/webserver/tutorial/README.md @@ -8,3 +8,9 @@ This application demonstrates various WebServer use cases together and in its co mvn package java -jar target/helidon-examples-webserver-tutorial.jar ``` + +run +```bash +curl -X POST http://localhost:8080/mgmt/shutdown +``` +in order to stop the server \ No newline at end of file