diff --git a/etc/scripts/RELEASE.md b/etc/scripts/RELEASE.md index 3bc74295..2022c365 100644 --- a/etc/scripts/RELEASE.md +++ b/etc/scripts/RELEASE.md @@ -26,14 +26,14 @@ Here is the overall procedure: # Steps in detail -``` +```shell # Set this to the version you are releasing. This should match the released version of Helidon export VERSION="3.0.0" ``` 1. Create local release branch - ``` + ```shell # Checkout dev branch into release branch git fetch origin git checkout -b release-${VERSION} origin/dev-3.x @@ -41,11 +41,11 @@ export VERSION="3.0.0" ``` 2. Update Helidon version used by examples. This should be a released version of Helidon - ``` + ```shell etc/scripts/updatehelidonversion.sh ${VERSION} ``` 3. Commit and Push local release branch to upstream to trigger release workflow. - ``` + ```shell mvn clean install # Do test build first git add . git commit @@ -53,7 +53,7 @@ export VERSION="3.0.0" ``` 4. After workflow completes check status. Check for creation of tag. Check that `helidon-3.x` branch has been updated. - ``` + ```shell git fetch -t origin # Checkout and verify branch git checkout helidon-3.x diff --git a/examples/README.md b/examples/README.md index abcc6419..6b3183df 100644 --- a/examples/README.md +++ b/examples/README.md @@ -12,7 +12,7 @@ That will quickly get you going with your first Helidon application. After that you can come back here and dig into the examples. To access these examples we recommend checking out from a released tag. For example: -``` +```shell git clone git@github.com:oracle/helidon.git cd helidon git checkout tags/2.0.0 @@ -21,7 +21,7 @@ git checkout tags/2.0.0 Our examples are Maven projects and can be built and run with Java 11 or newer -- so make sure you have those: -``` +```shell java -version mvn -version ``` @@ -31,14 +31,14 @@ mvn -version Each example has a `README` that you will follow. To build most examples just `cd` to the directory and run `mvn package`: -``` +```shell cd examples/microprofile/hello-world-explicit mvn package ``` Usually the example will produce an application jar file that you can run: -``` +```shell java -jar target/example-name.jar ``` diff --git a/examples/config/basics/README.md b/examples/config/basics/README.md index aa2aa316..e9478efd 100644 --- a/examples/config/basics/README.md +++ b/examples/config/basics/README.md @@ -10,7 +10,7 @@ containing config in HOCON (Human-Optimized Config Object Notation) format ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-config-basics.jar ``` diff --git a/examples/config/changes/README.md b/examples/config/changes/README.md index cdab258c..0b955c80 100644 --- a/examples/config/changes/README.md +++ b/examples/config/changes/README.md @@ -23,7 +23,7 @@ the most up-to-date value. Sometimes that is all you need. ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-config-changes.jar ``` diff --git a/examples/config/git/README.md b/examples/config/git/README.md index 17317d06..b808ffd7 100644 --- a/examples/config/git/README.md +++ b/examples/config/git/README.md @@ -21,7 +21,7 @@ checks to make sure the value is the expected `hello`. ## Build and run -```bash +```shell mvn package export ENVIRONMENT_NAME=test java -jar target/helidon-examples-config-git.jar diff --git a/examples/config/mapping/README.md b/examples/config/mapping/README.md index d8d561f3..8acf17ad 100644 --- a/examples/config/mapping/README.md +++ b/examples/config/mapping/README.md @@ -17,7 +17,7 @@ system how to construct a POJO instance. ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-config-mapping.jar ``` diff --git a/examples/config/metadata/README.md b/examples/config/metadata/README.md index 9e9448c8..7057c721 100644 --- a/examples/config/metadata/README.md +++ b/examples/config/metadata/README.md @@ -18,7 +18,7 @@ Example: ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-config-metadata.jar > application.yaml ``` diff --git a/examples/config/overrides/README.md b/examples/config/overrides/README.md index 3d539e3f..966a6435 100644 --- a/examples/config/overrides/README.md +++ b/examples/config/overrides/README.md @@ -21,7 +21,7 @@ take precedence over the settings in the original config sources. ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-config-overrides.jar ``` diff --git a/examples/config/sources/README.md b/examples/config/sources/README.md index 27e20509..e7afc2db 100644 --- a/examples/config/sources/README.md +++ b/examples/config/sources/README.md @@ -17,7 +17,7 @@ filter. ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-config-sources.jar ``` diff --git a/examples/cors/README.md b/examples/cors/README.md index 6fdaab0e..965600ab 100644 --- a/examples/cors/README.md +++ b/examples/cors/README.md @@ -14,7 +14,7 @@ uncomment that line and then package and run the application. ## Build and run -```bash +```shell mvn package java -jar helidon-examples-cors.jar ``` @@ -23,7 +23,7 @@ java -jar helidon-examples-cors.jar These normal greeting app endpoints work just as in the original greeting app: -```bash +```shell curl -X GET http://localhost:8080/greet {"message":"Hello World!"} @@ -45,7 +45,7 @@ The following requests illustrate the CORS protocol with the example app. By setting `Origin` and `Host` headers that do not indicate the same system we trigger CORS processing in the server: -```bash +```shell # Follow the CORS protocol for GET curl -i -X GET -H "Origin: http://foo.com" -H "Host: here.com" http://localhost:8080/greet @@ -63,7 +63,7 @@ Note the new headers `Access-Control-Allow-Origin` and `Vary` in the response. The same happens for a `GET` requesting a personalized greeting (by passing the name of the person to be greeted): -```bash +```shell curl -i -X GET -H "Origin: http://foo.com" -H "Host: here.com" http://localhost:8080/greet/Joe {"greeting":"Hola Joe!"} ``` @@ -83,7 +83,7 @@ The CORS protocol requires the client to send a _pre-flight_ request before send This command sends a pre-flight `OPTIONS` request to see if the server will accept a subsequent `PUT` request from the specified origin to change the greeting: -```bash +```shell curl -i -X OPTIONS \ -H "Access-Control-Request-Method: PUT" \ -H "Origin: http://foo.com" \ @@ -100,7 +100,7 @@ connection: keep-alive The successful status and the returned `Access-Control-Allow-xxx` headers indicate that the server accepted the pre-flight request. That means it is OK for us to send `PUT` request to perform the actual change of greeting. (See below for how the server rejects a pre-flight request.) -```bash +```shell curl -i -X PUT \ -H "Origin: http://foo.com" \ -H "Host: here.com" \ @@ -117,7 +117,7 @@ Vary: Origin connection: keep-alive ``` And we run one more `GET` to observe the change in the greeting: -```bash +```shell curl -i -X GET -H "Origin: http://foo.com" -H "Host: here.com" http://localhost:8080/greet/Joe {"greeting":"Cheers Joe!"} ``` @@ -131,7 +131,7 @@ need this feature, but the example shows how easy it is to add. With the same server running, repeat the `OPTIONS` request from above, but change the `Origin` header to refer to `other.com`: -```bash +```shell curl -i -X OPTIONS \ -H "Access-Control-Request-Method: PUT" \ -H "Origin: http://other.com" \ @@ -146,12 +146,12 @@ This fails because the app set up CORS using the "restrictive-cors" configuratio sharing only with `foo.com` and `there.com`, not with `other.com`. Stop the running app, uncomment the commented section at the end of `application.yaml`, and build and run the app again. -```bash +```shell mvn package java -jar helidon-examples-cors.jar ``` Send the previous `OPTIONS` request again and note the successful result: -```bash +```shell HTTP/1.1 200 OK Access-Control-Allow-Methods: PUT Access-Control-Allow-Origin: http://other.com diff --git a/examples/dbclient/pokemons/README.md b/examples/dbclient/pokemons/README.md index 3b8a8c93..2bd542d3 100644 --- a/examples/dbclient/pokemons/README.md +++ b/examples/dbclient/pokemons/README.md @@ -36,12 +36,12 @@ To switch between JDBC drivers: ## Build To build a jar file -``` +```shell mvn package ``` To build a native image (supported only with Oracle, MongoDB, or H2 databases) -``` +```shell mvn package -Pnative-image ``` @@ -53,19 +53,19 @@ Start your database before running this example. Example docker commands to start databases in temporary containers: Oracle: -``` +```shell docker run --rm --name xe -p 1521:1521 -p 8888:8080 wnameless/oracle-xe-11g-r2 ``` For details on an Oracle Docker image, see https://github.com/oracle/docker-images/tree/master/OracleDatabase/SingleInstance H2: -``` +```shell docker run --rm --name h2 -p 9092:9082 -p 8082:8082 nemerosa/h2 ``` For details, see http://www.h2database.com/html/cheatSheet.html MySQL: -``` +```shell docker run --rm --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root \ -e MYSQL_DATABASE=pokemon -e MYSQL_USER=user -e MYSQL_PASSWORD=password mysql:5.7 ``` diff --git a/examples/employee-app/README.md b/examples/employee-app/README.md index 25f8aeaa..09678b9b 100644 --- a/examples/employee-app/README.md +++ b/examples/employee-app/README.md @@ -13,7 +13,7 @@ The service uses Helidon DB Client that provides reactive and non-blocking acces ## Build and run -```bash +```shell mvn package java -jar target/employee-app.jar ``` @@ -38,7 +38,7 @@ CREATE SEQUENCE EMPLOYEE_SEQ INCREMENT BY 1 NOCACHE NOCYCLE; ## Exercise the application Get all employees. -```sh +```shell curl -X GET curl -X GET http://localhost:8080/employees ``` @@ -60,7 +60,7 @@ Only 1 output record is shown for brevity: Get all employees whose last name contains "S". -```sh +```shell curl -X GET http://localhost:8080/employees/lastname/S ``` @@ -81,7 +81,7 @@ Only 1 output record is shown for brevity: ``` Get an individual record. -```sh +```shell curl -X GET http://localhost:8080/employees/48cf06ad-6ed4-47e6-ac44-3ea9c67cbe2d ``` Output: @@ -108,7 +108,7 @@ http://localhost:8080/public/index.html ## Try health and metrics -```sh +```shell curl -s -X GET http://localhost:8080/health ``` @@ -150,7 +150,7 @@ curl -s -X GET http://localhost:8080/health ### Prometheus Format -```sh +```shell curl -s -X GET http://localhost:8080/metrics ``` @@ -162,7 +162,7 @@ base:classloader_current_loaded_class_count 3995 ``` ### JSON Format -```sh +```shell curl -H 'Accept: application/json' -X GET http://localhost:8080/metrics ``` @@ -210,13 +210,13 @@ Output: ## Build the Docker Image -```sh +```shell docker build -t employee-app . ``` ## Start the application with Docker -```sh +```shell docker run --rm -p 8080:8080 employee-app:latest ``` diff --git a/examples/graphql/basics/README.md b/examples/graphql/basics/README.md index 3e39e8d9..eb43abe7 100644 --- a/examples/graphql/basics/README.md +++ b/examples/graphql/basics/README.md @@ -7,7 +7,7 @@ manually creates a GraphQL Schema using the [GraphQL Java](https://github.com/gr Start the application: -```bash +```shell mvn package java -jar target/helidon-examples-graphql-basics.jar ``` @@ -18,7 +18,7 @@ Probe the GraphQL endpoints: 1. Hello word endpoint: - ```bash + ```shell curl -X POST http://127.0.0.1:PORT/graphql -d '{"query":"query { hello }"}' "data":{"hello":"world"}} @@ -26,7 +26,7 @@ Probe the GraphQL endpoints: 1. Hello in different languages - ```bash + ```shell curl -X POST http://127.0.0.1:PORT/graphql -d '{"query":"query { helloInDifferentLanguages }"}' {"data":{"helloInDifferentLanguages":["Bonjour","Hola","Zdravstvuyte","Nǐn hǎo","Salve","Gudday","Konnichiwa","Guten Tag"]}} diff --git a/examples/grpc/basics/README.md b/examples/grpc/basics/README.md index b8ad4b84..1f2937a6 100644 --- a/examples/grpc/basics/README.md +++ b/examples/grpc/basics/README.md @@ -4,19 +4,19 @@ A basic example gRPC server. ## Build and run -```bash +```shell mvn -f ../pom.xml -pl common,basics package java -jar target/helidon-examples-grpc-basics.jar ``` Exercise the example: -```bash +```shell java -cp target/helidon-examples-grpc-basics.jar \ io.helidon.grpc.examples.basics.HealthClient ``` The HealthClient will give this output: -```bash +```shell GreetService response -> status: SERVING FooService StatusRuntimeException.getMessage() -> NOT_FOUND: Service 'FooService' does not exist or does not have a registered health check diff --git a/examples/grpc/client-standalone/README.md b/examples/grpc/client-standalone/README.md index 09c90c68..36c87d52 100644 --- a/examples/grpc/client-standalone/README.md +++ b/examples/grpc/client-standalone/README.md @@ -7,7 +7,7 @@ implemented. ## Build and run -```bash +```shell mvn -f ../pom.xml -pl common,client-standalone package java -jar target/helidon-examples-grpc-client-standalone.jar ``` diff --git a/examples/grpc/metrics/README.md b/examples/grpc/metrics/README.md index 8a8265b5..fa47c3f1 100644 --- a/examples/grpc/metrics/README.md +++ b/examples/grpc/metrics/README.md @@ -4,28 +4,28 @@ A basic example using metrics with gRPC server. ## Build and run -```bash +```shell mvn -f ../pom.xml -pl common,metrics package java -jar target/helidon-examples-grpc-metrics.jar ``` Run the GreetService client: -```bash +```shell java -cp target/helidon-examples-grpc-metrics.jar io.helidon.grpc.examples.common.GreetClient ``` Run the StringService client: -```bash +```shell java -cp target/helidon-examples-grpc-metrics.jar io.helidon.grpc.examples.common.StringClient ``` Retrieve the metrics: -```bash +```shell curl http://localhost:8080/metrics ``` Notice that you will get application metrics from the Helidon server metric response similar to this: -```bash +```shell ... # TYPE application_GreetService_Greet_total counter # HELP application_GreetService_Greet_total diff --git a/examples/grpc/microprofile/basic-client/README.md b/examples/grpc/microprofile/basic-client/README.md index c129bea1..1be7badc 100644 --- a/examples/grpc/microprofile/basic-client/README.md +++ b/examples/grpc/microprofile/basic-client/README.md @@ -12,18 +12,18 @@ the client will use is represented by an annotated interface `io.helidon.micropr which defines all of the methods available on the service deployed on the server. ## Build -```bash +```shell mvn -f ../../pom.xml -pl common,microprofile/basic-client package ``` ## Run Ensure that the server in [Basic Implicit gRPC Server example](../basic-server-implicit/README.md) is started. Then in this module run: -```bash +```shell java -jar target/helidon-examples-grpc-microprofile-client.jar ``` Sample output from the client: -```bash +```shell ... Unary Lower response: 'abcd' Response from blocking Split: 'A' diff --git a/examples/grpc/microprofile/basic-server-implicit/README.md b/examples/grpc/microprofile/basic-server-implicit/README.md index 65feee1c..fd7a1f9d 100644 --- a/examples/grpc/microprofile/basic-server-implicit/README.md +++ b/examples/grpc/microprofile/basic-server-implicit/README.md @@ -18,13 +18,13 @@ which provides a microprofile gRPC client that uses the services deployed in thi ## Build -```bash +```shell mvn -f ../../pom.xml -pl common,microprofile/basic-server-implicit package ``` ## Run -```bash +```shell java -jar target/helidon-examples-grpc-microprofile-basic-implicit.jar ``` diff --git a/examples/grpc/microprofile/metrics/README.md b/examples/grpc/microprofile/metrics/README.md index 1b82b487..86bee07d 100644 --- a/examples/grpc/microprofile/metrics/README.md +++ b/examples/grpc/microprofile/metrics/README.md @@ -9,24 +9,24 @@ which provides a microprofile gRPC client that uses the services deployed in thi ## Build and run -```bash +```shell mvn -f ../../pom.xml -pl common,microprofile/metrics package java -jar target/helidon-examples-grpc-microprofile-metrics.jar ``` Run the basic-client from [Basic gRPC Client example](../basic-client/README.md) to invoke activity on the gRPC endpoint `localhost:1408`. -```bash +```shell java -jar target/helidon-examples-grpc-microprofile-client.jar ``` Retrieve the metrics: -```bash +```shell curl http://localhost:8080/metrics ``` Notice that you will get application metrics from the Helidon server metric response similar to this: -```bash +```shell ... # TYPE application_io_helidon_microprofile_grpc_example_metrics_StringService_echo_total counter # HELP application_io_helidon_microprofile_grpc_example_metrics_StringService_echo_total diff --git a/examples/grpc/opentracing/README.md b/examples/grpc/opentracing/README.md index 94fb16ff..d0e45cec 100644 --- a/examples/grpc/opentracing/README.md +++ b/examples/grpc/opentracing/README.md @@ -3,23 +3,23 @@ ## Start Zipkin With Docker: -```bash +```shell docker run --name zipkin -d -p 9411:9411 openzipkin/zipkin ``` -```bash +```shell curl -sSL https://zipkin.io/quickstart.sh | bash -s java -jar zipkin.jar ``` ## Build and run -```bash +```shell mvn -f ../pom.xml -pl common,opentracing package java -jar target/helidon-examples-grpc-opentracing.jar ``` Exercise the gRPC endpoint with GreeClient and StringClient: -```bash +```shell java -cp target/helidon-examples-grpc-opentracing.jar io.helidon.grpc.examples.common.GreetClient java -cp target/helidon-examples-grpc-opentracing.jar io.helidon.grpc.examples.common.StringClient ``` @@ -27,6 +27,6 @@ java -cp target/helidon-examples-grpc-opentracing.jar io.helidon.grpc.examples.c Then check out the traces at http://localhost:9411 from a browser. Stop zipkin if run with the docker container: -```bash +```shell docker stop zipkin && docker rm zipkin ``` diff --git a/examples/grpc/security-abac/README.md b/examples/grpc/security-abac/README.md index 7767713b..197c8d41 100644 --- a/examples/grpc/security-abac/README.md +++ b/examples/grpc/security-abac/README.md @@ -4,30 +4,30 @@ An example gRPC server for attribute based access control. ## Build and run Build: -```bash +```shell mvn -f ../pom.xml -pl common,security-abac package ``` Run using programmatic ABAC setup(see [AbacServer.java](src/main/java/io/helidon/grpc/examples/security/abac/AbacServer.java)): -```bash +```shell java -jar target/helidon-examples-grpc-security-abac.jar ``` Run using ABAC config setup (see [application.yaml](src/main/resources/application.yaml)): -```bash +```shell java -cp target/helidon-examples-grpc-security-abac.jar \ io.helidon.grpc.examples.security.abac.AbacServerFromConfig ``` Exercise the example using SecureStringClient: -```bash +```shell java -cp target/helidon-examples-grpc-security-abac.jar \ io.helidon.grpc.examples.security.abac.SecureStringClient ``` The client will only fail if parameters are not within the ABAC attributes setup. For example, below failed because the request was made outside the `time-of-day` attribute range: -```bash +```shell Jul 20, 2022 12:27:39 PM io.helidon.security.DefaultAuditProvider lambda$logEvent$1 FINEST: FAILURE authz.authorize 71e94b20-961c-4123-8f8b-ad8c365b8f80:1 io.helidon.common.context.Contexts runInContext Contexts.java 117 :: "Path Optional[StringService/Upper]. Provider io.helidon.security.providers.abac.AbacProvider, Description io.helidon.security.AuthorizationClientImpl@186478ad, Request Optional[Subject: Principal: Principal{properties=BasicAttributes{registry={name=user, id=user}}, name='user', id='user'} Principal: role:user_role Principal: scope:calendar_read Principal: scope:calendar_edit ]. Subject FATAL: 12:27:38 is in neither of allowed times: [08:15 - 12:00, 12:30 - 17:30] at io.helidon.security.abac.time.TimeValidator@72486851" Jul 20, 2022 12:27:39 PM io.helidon.security.DefaultAuditProvider lambda$logEvent$1 diff --git a/examples/grpc/security-outbound/README.md b/examples/grpc/security-outbound/README.md index 5c1c2157..ae2563e2 100644 --- a/examples/grpc/security-outbound/README.md +++ b/examples/grpc/security-outbound/README.md @@ -4,19 +4,19 @@ An example gRPC outbound security ## Build and run -```bash +```shell mvn -f ../pom.xml -pl common,security-outbound package java -jar target/helidon-examples-grpc-security-outbound.jar ``` Exercise the example: -```bash +```shell java -cp target/helidon-examples-grpc-security-outbound.jar \ io.helidon.grpc.examples.security.outbound.SecureGreetClient ``` Sample output of the client: -```bash +```shell bob Greeting set to: MERHABA bob diff --git a/examples/grpc/security/README.md b/examples/grpc/security/README.md index a1aa4ccc..2df53fed 100644 --- a/examples/grpc/security/README.md +++ b/examples/grpc/security/README.md @@ -4,13 +4,13 @@ An example gRPC server using basic auth security. ## Build and run -```bash +```shell mvn -f ../pom.xml -pl common,security package java -jar target/helidon-examples-grpc-security.jar ``` # Exercise the example: -```bash +```shell java -cp target/helidon-examples-grpc-security.jar \ io.helidon.grpc.examples.security.SecureGreetClient java -cp target/helidon-examples-grpc-security.jar \ @@ -19,7 +19,7 @@ java -cp target/helidon-examples-grpc-security.jar \ # Sample client output: SecureGreetClient: -```bash +```shell message: "Hello Aleks!" greeting: "Hey" @@ -28,6 +28,6 @@ message: "Hey Aleks!" ``` SecureStringClient: -```bash +```shell Response from Lower method call is 'abcde' ``` diff --git a/examples/health/basics/README.md b/examples/health/basics/README.md index bca6a94a..aeb9a8a3 100644 --- a/examples/health/basics/README.md +++ b/examples/health/basics/README.md @@ -8,7 +8,7 @@ custom health check. Start the application: -```bash +```shell mvn package java -jar target/helidon-examples-health-basics.jar ``` @@ -17,7 +17,7 @@ Note the port number reported by the application. Probe the health endpoints: -```bash +```shell curl -X GET http://localhost:PORT/health/ curl -X GET http://localhost:PORT/health/ready diff --git a/examples/integrations/cdi/datasource-hikaricp-h2/README.md b/examples/integrations/cdi/datasource-hikaricp-h2/README.md index 31b6042c..d630d6a6 100644 --- a/examples/integrations/cdi/datasource-hikaricp-h2/README.md +++ b/examples/integrations/cdi/datasource-hikaricp-h2/README.md @@ -8,12 +8,12 @@ database. ## Build and run -```bash +```shell mvn package java -jar target/helidon-integrations-examples-datasource-hikaricp-h2.jar ``` Try the endpoint: -```bash +```shell curl http://localhost:8080/tables ``` diff --git a/examples/integrations/cdi/datasource-hikaricp-mysql/README.md b/examples/integrations/cdi/datasource-hikaricp-mysql/README.md index 3c29030a..bd7e409d 100644 --- a/examples/integrations/cdi/datasource-hikaricp-mysql/README.md +++ b/examples/integrations/cdi/datasource-hikaricp-mysql/README.md @@ -13,7 +13,7 @@ To run MySQL's `mysql:8` Docker image in a Docker container named and uses `tiger` as the MySQL root password and that will automatically be removed when it is stopped: -```sh +```shell docker container run --rm -d -p 3306:3306 \ --env MYSQL_ROOT_PASSWORD=tiger \ --name mysql \ @@ -30,7 +30,7 @@ running in this Docker container, verify that the following lines (among others) are present in `src/main/resources/META-INF/microprofile-config.properties`: -```sh +```shell javax.sql.DataSource.example.dataSourceClassName=com.mysql.cj.jdbc.MysqlDataSource javax.sql.DataSource.example.dataSource.url = jdbc:mysql://localhost:3306 javax.sql.DataSource.example.dataSource.user = root @@ -40,18 +40,18 @@ javax.sql.DataSource.example.dataSource.password = tiger ## Build and run -```bash +```shell mvn package java -jar target/helidon-integrations-examples-datasource-hikaricp-mysql.jar ``` Try the endpoint: -```sh +```shell curl http://localhost:8080/tables ``` Stop the docker container: -```bash +```shell docker stop mysql ``` diff --git a/examples/integrations/cdi/datasource-hikaricp/README.md b/examples/integrations/cdi/datasource-hikaricp/README.md index 7a54e43f..cb72a0de 100644 --- a/examples/integrations/cdi/datasource-hikaricp/README.md +++ b/examples/integrations/cdi/datasource-hikaricp/README.md @@ -20,7 +20,7 @@ account if you don't already have one, see To log in to the Oracle Container Registry (which you will need to do in order to download Oracle database Docker images from it): -```bash +```shell docker login -u username -p password container-registry.oracle.com ``` @@ -31,7 +31,7 @@ To run Oracle's `database/standard` Docker image in a Docker container named `oracle` that publishes ports 1521 and 5500 to the host while relying on the defaults for all other settings: -```bash +```shell docker container run -d -it -p 1521:1521 -p 5500:5500 --shm-size=3g \ --name oracle \ container-registry.oracle.com/database/standard:latest @@ -58,7 +58,7 @@ javax.sql.DataSource.example.dataSource.password = Oracle ## Build and run With Docker: -```bash +```shell docker build -t helidon-examples-integrations-datasource-hikaricp . docker run --rm -d \ --link oracle \ @@ -69,17 +69,17 @@ docker run --rm -d \ OR With Maven: -```bash +```shell mvn package java -jar target/helidon-examples-integrations-datasource-hikaricp.jar ``` Try the endpoint: -```bash +```shell curl http://localhost:8080/tables ``` Stop the docker containers: -```bash +```shell docker stop oracle helidon-examples-integrations-datasource-hikaricp ``` diff --git a/examples/integrations/cdi/jedis/README.md b/examples/integrations/cdi/jedis/README.md index 51311df1..6bfc0509 100644 --- a/examples/integrations/cdi/jedis/README.md +++ b/examples/integrations/cdi/jedis/README.md @@ -2,14 +2,14 @@ ## Start Redis -```bash +```shell docker run --rm --name redis -d -p 6379:6379 redis ``` ## Build and run With Docker: -```bash +```shell docker build -t helidon-examples-integrations-cdi-jedis . docker run --rm -d \ --link redis @@ -18,20 +18,20 @@ docker run --rm -d \ ``` With Java: -```bash +```shell mvn package java -jar target/helidon-examples-integrations-cdi-jedis.jar ``` Try the endpoint: -```bash +```shell curl -X PUT -H "Content-Type: text/plain" http://localhost:8080/jedis/foo -d 'bar' curl http://localhost:8080/jedis/foo ``` ## Run with Kubernetes (docker for desktop) -```bash +```shell docker build -t helidon-examples-integrations-cdi-jedis . kubectl apply \ -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/ingress-nginx-3.15.2/deploy/static/provider/cloud/deploy.yaml \ @@ -39,17 +39,17 @@ kubectl apply \ ``` Try the endpoint: -```bash +```shell curl -X PUT -H "Content-Type: text/plain" http://localhost/helidon-cdi-jedis/jedis/foo -d 'bar' curl http://localhost/helidon-cdi-jedis/jedis/foo ``` Stop the docker containers: -```bash +```shell docker stop redis helidon-examples-integrations-cdi-jedis ``` Delete the Kubernetes resources: -```bash +```shell kubectl delete -f app.yaml ``` diff --git a/examples/integrations/cdi/jpa/README.md b/examples/integrations/cdi/jpa/README.md index c505468b..5a202ed5 100644 --- a/examples/integrations/cdi/jpa/README.md +++ b/examples/integrations/cdi/jpa/README.md @@ -1,13 +1,13 @@ # JPA Integration Example With Java: -```bash +```shell mvn package java -jar target/helidon-integrations-examples-jpa.jar ``` Try the endpoint: -```bash +```shell curl -X POST -H "Content-Type: text/plain" http://localhost:8080/foo -d 'bar' curl http://localhost:8080/foo ``` diff --git a/examples/integrations/cdi/pokemons/README.md b/examples/integrations/cdi/pokemons/README.md index 77dff66a..da0cc9c3 100644 --- a/examples/integrations/cdi/pokemons/README.md +++ b/examples/integrations/cdi/pokemons/README.md @@ -1,7 +1,7 @@ # JPA Pokemons Example With Java: -```bash +```shell mvn package java -jar target/helidon-integrations-examples-pokemons.jar ``` diff --git a/examples/integrations/micrometer/mp/README.md b/examples/integrations/micrometer/mp/README.md index e15d9501..95501608 100644 --- a/examples/integrations/micrometer/mp/README.md +++ b/examples/integrations/micrometer/mp/README.md @@ -22,7 +22,7 @@ The example is similar to the one from the Helidon MP QuickStart with these diff ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-integrations-micrometer-mp.jar ``` @@ -31,7 +31,7 @@ java -jar target/helidon-examples-integrations-micrometer-mp.jar These normal greeting app endpoints work just as in the original greeting app: -```bash +```shell curl -X GET http://localhost:8080/greet {"message":"Hello World!"} @@ -48,7 +48,7 @@ curl -X GET http://localhost:8080/greet/Jose Access the `/micrometer` endpoint which reports the newly-added timer and counter. -```bash +```shell curl http://localhost:8080/micrometer ``` Because the `@Timer` annotation specifies a histogram, diff --git a/examples/integrations/micrometer/se/README.md b/examples/integrations/micrometer/se/README.md index 299c7bca..6002e342 100644 --- a/examples/integrations/micrometer/se/README.md +++ b/examples/integrations/micrometer/se/README.md @@ -34,7 +34,7 @@ The `GreetingService` class ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-integrations-micrometer-se.jar ``` @@ -43,7 +43,7 @@ java -jar target/helidon-examples-integrations-micrometer-se.jar These normal greeting app endpoints work just as in the original greeting app: -```bash +```shell curl -X GET http://localhost:[PORT]/greet {"message":"Hello World!"} @@ -59,7 +59,7 @@ curl -X GET http://localhost:[PORT]/greet/Jose ## Using Micrometer Access the `/micrometer` endpoint which reports the newly-added timer and counter. -```bash +```shell curl http://localhost:8080/micrometer ``` diff --git a/examples/integrations/micronaut/data/README.md b/examples/integrations/micronaut/data/README.md index afd82933..8943e6f4 100644 --- a/examples/integrations/micronaut/data/README.md +++ b/examples/integrations/micronaut/data/README.md @@ -28,14 +28,14 @@ The following classes are pure Micronaut beans (and cannot have CDI injected int Start the application: -```bash +```shell mvn package java -jar target/helidon-examples-integrations-micronaut-data.jar ``` Access endpoints -```bash +```shell # Get all pets curl -i http://localhost:8080/pets # Get all owners diff --git a/examples/integrations/microstream/greetings-se/README.md b/examples/integrations/microstream/greetings-se/README.md index c05d202a..99191f66 100644 --- a/examples/integrations/microstream/greetings-se/README.md +++ b/examples/integrations/microstream/greetings-se/README.md @@ -4,7 +4,7 @@ This example uses Microstream to persist a log entry for every greeting ## Build and run -``` +```shell mvn package java -jar target/helidon-examples-integrations-microstream-greetings-se.jar ``` diff --git a/examples/integrations/neo4j/neo4j-mp/README.md b/examples/integrations/neo4j/neo4j-mp/README.md index 8a6e4115..3c1fed62 100644 --- a/examples/integrations/neo4j/neo4j-mp/README.md +++ b/examples/integrations/neo4j/neo4j-mp/README.md @@ -6,7 +6,7 @@ This example implements a simple Neo4j REST service using MicroProfile. Bring up a Neo4j instance via Docker -```bash +```shell docker run --publish=7474:7474 --publish=7687:7687 -e 'NEO4J_AUTH=neo4j/secret' neo4j:4.0 ``` @@ -14,7 +14,7 @@ Goto the Neo4j browser and play the first step of the movies graph: [`:play movi Then build -```bash +```shell mvn package java -jar target/helidon-examples-integration-neo4j-mp.jar ``` diff --git a/examples/integrations/neo4j/neo4j-se/README.md b/examples/integrations/neo4j/neo4j-se/README.md index 96ee4e48..155b934a 100644 --- a/examples/integrations/neo4j/neo4j-se/README.md +++ b/examples/integrations/neo4j/neo4j-se/README.md @@ -4,14 +4,14 @@ Bring up a Neo4j instance via Docker -```bash +```shell docker run --publish=7474:7474 --publish=7687:7687 -e 'NEO4J_AUTH=neo4j/secret' neo4j:4.0 ``` Goto the Neo4j browser and play the first step of the movies graph: [`:play movies`](http://localhost:7474/browser/?cmd=play&arg=movies). Build and run -```bash +```shell mvn package java -jar target/helidon-examples-integration-neo4j-se.jar ``` diff --git a/examples/jbatch/README.md b/examples/jbatch/README.md index 47857cc9..f964497f 100644 --- a/examples/jbatch/README.md +++ b/examples/jbatch/README.md @@ -4,13 +4,13 @@ Minimal Helidon MP + jBatch PoC. ## Build and run -```bash +```shell mvn package java -jar target/helidon-example-jbatch.jar ``` ## Exercise the application -``` +```shell curl -X GET http://localhost:8080/batch ``` \ No newline at end of file diff --git a/examples/logging/logback-aot/README.md b/examples/logging/logback-aot/README.md index 4cf31152..b9a245b1 100644 --- a/examples/logging/logback-aot/README.md +++ b/examples/logging/logback-aot/README.md @@ -30,12 +30,12 @@ The output is also logged into `helidon.log`. # Running as jar Build this application: -```shell script +```shell mvn clean package ``` Run from command line: -```shell script +```shell java -jar target/helidon-examples-logging-slf4j-aot.jar ``` diff --git a/examples/messaging/README.md b/examples/messaging/README.md index 86cbfcf3..047adfde 100644 --- a/examples/messaging/README.md +++ b/examples/messaging/README.md @@ -19,19 +19,19 @@ small, pocket size and pre-configured testing Kafka server Docker image is avail ### Test JMS server * Start ActiveMQ server locally: -```bash +```shell docker run --name='activemq' --rm -p 61616:61616 -p 8161:8161 rmohr/activemq ``` ### Test Oracle database * Start ActiveMQ server locally: -```bash +```shell cd ./docker/oracle-aq-18-xe ./buildAndRun.sh ``` For stopping Oracle database container use: -```bash +```shell cd ./docker/oracle-aq-18-xe ./stopAndClean.sh ``` diff --git a/examples/metrics/exemplar/README.md b/examples/metrics/exemplar/README.md index 09125f0f..e41542d6 100644 --- a/examples/metrics/exemplar/README.md +++ b/examples/metrics/exemplar/README.md @@ -9,13 +9,13 @@ when it cannot contact the Zipkin server to report the tracing spans. Even so, t will contain valid exemplars. With Docker: -```bash +```shell docker run --name zipkin -d -p 9411:9411 openzipkin/zipkin ``` ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-metrics-exemplar.jar ``` diff --git a/examples/metrics/filtering/mp/README.md b/examples/metrics/filtering/mp/README.md index 02e74162..d1e77be7 100644 --- a/examples/metrics/filtering/mp/README.md +++ b/examples/metrics/filtering/mp/README.md @@ -5,7 +5,7 @@ optional metrics exemplar support. ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-metrics-filtering-mp.jar ``` diff --git a/examples/metrics/filtering/se/README.md b/examples/metrics/filtering/se/README.md index 8a79ed34..e6bccfad 100644 --- a/examples/metrics/filtering/se/README.md +++ b/examples/metrics/filtering/se/README.md @@ -5,7 +5,7 @@ optional metrics exemplar support. ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-metrics-se.jar ``` diff --git a/examples/metrics/http-status-count-se/README.md b/examples/metrics/http-status-count-se/README.md index 4a0e2713..8507ba14 100644 --- a/examples/metrics/http-status-count-se/README.md +++ b/examples/metrics/http-status-count-se/README.md @@ -23,32 +23,32 @@ Use this example for inspiration in writing your own service or just use the `Ht ## Build and run -```bash +```shell mvn package java -jar target/http-status-count-se.jar ``` ## Exercise the application -```bash +```shell curl -X GET http://localhost:8080/simple-greet ``` ```listing {"message":"Hello World!"} ``` -```bash +```shell curl -X GET http://localhost:8080/greet ``` ```listing {"message":"Hello World!"} ``` -```bash +```shell curl -X GET http://localhost:8080/greet/Joe ``` ```listing {"message":"Hello Joe!"} ``` -```bash +```shell curl -X PUT -H "Content-Type: application/json" -d '{"greeting" : "Hola"}' http://localhost:8080/greet/greeting curl -X GET http://localhost:8080/greet/Jose @@ -58,7 +58,7 @@ curl -X GET http://localhost:8080/greet/Jose ``` ## Try metrics -```bash +```shell # Prometheus Format curl -s -X GET http://localhost:8080/metrics/application ``` @@ -76,7 +76,7 @@ application_httpStatus_total{range="5xx"} 0 ``` # JSON Format -```bash +```shell curl -H "Accept: application/json" -X GET http://localhost:8080/metrics ``` ```json @@ -92,7 +92,7 @@ curl -H "Accept: application/json" -X GET http://localhost:8080/metrics ## Try health -```bash +```shell curl -s -X GET http://localhost:8080/health ``` ```listing diff --git a/examples/metrics/kpi/README.md b/examples/metrics/kpi/README.md index c0fe038d..7f1a4d19 100644 --- a/examples/metrics/kpi/README.md +++ b/examples/metrics/kpi/README.md @@ -11,15 +11,15 @@ You would typically write any given application to use only one of the approache ## Build and run -```bash +```shell mvn package ``` To use programmatic set-up: -```bash +```shell java -jar target/helidon-examples-metrics-kpi.jar ``` To use configuration: -```bash +```shell java -DuseConfig=true -jar target/helidon-examples-metrics-kpi.jar ```` @@ -100,7 +100,7 @@ vendor_requests_load_fifteen_min_rate_per_second 0.005104944851522425 ## JSON output -```bash +```shell curl -s -X GET -H "Accept: application/json" http://localhost:8080/metrics/vendor { ... diff --git a/examples/microprofile/bean-validation/README.md b/examples/microprofile/bean-validation/README.md index a31bab2e..94e99cbf 100644 --- a/examples/microprofile/bean-validation/README.md +++ b/examples/microprofile/bean-validation/README.md @@ -15,7 +15,7 @@ To be able to use bean validation add the following dependency: ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-microprofile-bean-validation.jar ``` diff --git a/examples/microprofile/cors/README.md b/examples/microprofile/cors/README.md index eeb188f5..5cb6ef93 100644 --- a/examples/microprofile/cors/README.md +++ b/examples/microprofile/cors/README.md @@ -9,7 +9,7 @@ uncomment that line and then package and run the application. ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-microprofile-cors.jar ``` @@ -18,7 +18,7 @@ java -jar target/helidon-examples-microprofile-cors.jar These normal greeting app endpoints work just as in the original greeting app: -```bash +```shell curl -X GET http://localhost:8080/greet {"message":"Hello World!"} @@ -40,7 +40,7 @@ The following requests illustrate the CORS protocol with the example app. By setting `Origin` and `Host` headers that do not indicate the same system we trigger CORS processing in the server: -```bash +```shell # Follow the CORS protocol for GET curl -i -X GET -H "Origin: http://foo.com" -H "Host: here.com" http://localhost:8080/greet @@ -58,7 +58,7 @@ Note the new headers `Access-Control-Allow-Origin` and `Vary` in the response. The same happens for a `GET` requesting a personalized greeting (by passing the name of the person to be greeted): -```bash +```shell curl -i -X GET -H "Origin: http://foo.com" -H "Host: here.com" http://localhost:8080/greet/Joe {"greeting":"Hola Joe!"} ``` @@ -83,7 +83,7 @@ requests as "non-simple" ones. This command sends a pre-flight `OPTIONS` request to see if the server will accept a subsequent `PUT` request from the specified origin to change the greeting: -```bash +```shell curl -i -X OPTIONS \ -H "Access-Control-Request-Method: PUT" \ -H "Origin: http://foo.com" \ @@ -100,7 +100,7 @@ connection: keep-alive The successful status and the returned `Access-Control-Allow-xxx` headers indicate that the server accepted the pre-flight request. That means it is OK for us to send `PUT` request to perform the actual change of greeting. (See below for how the server rejects a pre-flight request.) -```bash +```shell curl -i -X PUT \ -H "Origin: http://foo.com" \ -H "Host: here.com" \ @@ -117,7 +117,7 @@ Vary: Origin connection: keep-alive ``` And we run one more `GET` to observe the change in the greeting: -```bash +```shell curl -i -X GET -H "Origin: http://foo.com" -H "Host: here.com" http://localhost:8080/greet/Joe {"greeting":"Cheers Joe!"} ``` diff --git a/examples/microprofile/graphql/README.md b/examples/microprofile/graphql/README.md index 00ed22f3..d38299aa 100644 --- a/examples/microprofile/graphql/README.md +++ b/examples/microprofile/graphql/README.md @@ -10,13 +10,13 @@ for an introduction to using GraphQL in Helidon MP. 1. Build -```bash +```shell mvn clean install ``` 2. Run the example -```bash +```shell java -jar target/helidon-examples-microprofile-graphql.jar ``` @@ -26,7 +26,7 @@ Access the `/graphql` endpoint via `http://127.0.0.1:7001/graphql`: 1. Display the generated GraphQL Schema - ```bash + ```shell curl http://127.0.0.1:7001/graphql/schema.graphql ``` @@ -64,7 +64,7 @@ Access the `/graphql` endpoint via `http://127.0.0.1:7001/graphql`: 1. Create a Task - ```bash + ```shell curl -X POST http://127.0.0.1:7001/graphql -d '{"query":"mutation createTask { createTask(description: \"Task Description 1\") { id description createdAt completed }}"}' ``` @@ -84,7 +84,7 @@ In the case below we have also appended `/application` to the URL to just retrie > Note: `jq` has been used to format the JSON output. This can be downloaded from https://stedolan.github.io/jq/download/ or you can > format the output with an alternate utility. -```bash +```shell $ curl -H 'Accept: application/json' http://127.0.0.1:7001/metrics/application | jq { diff --git a/examples/microprofile/hello-world-explicit/README.md b/examples/microprofile/hello-world-explicit/README.md index 8ab9bac0..dccd55b6 100644 --- a/examples/microprofile/hello-world-explicit/README.md +++ b/examples/microprofile/hello-world-explicit/README.md @@ -4,7 +4,7 @@ This examples shows a simple application written using Helidon MP. It is explicit because in this example you write the `main` class and explicitly start the microprofile server. -```bash +```shell mvn package java -jar target/helidon-examples-microprofile-hello-world-explicit.jar ``` diff --git a/examples/microprofile/hello-world-implicit/README.md b/examples/microprofile/hello-world-implicit/README.md index 393607f0..2144646a 100644 --- a/examples/microprofile/hello-world-implicit/README.md +++ b/examples/microprofile/hello-world-implicit/README.md @@ -6,7 +6,7 @@ It is implicit because in this example you don't write the ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-microprofile-hello-world-implicit.jar ``` diff --git a/examples/microprofile/http-status-count-mp/README.md b/examples/microprofile/http-status-count-mp/README.md index fea3cfe5..6c9d82bf 100644 --- a/examples/microprofile/http-status-count-mp/README.md +++ b/examples/microprofile/http-status-count-mp/README.md @@ -10,32 +10,32 @@ Use this example for inspiration in writing your own filter or just use the filt ## Build and run -```bash +```shell mvn package java -jar target/http-status-count-mp.jar ``` ## Exercise the application -```bash +```shell curl -X GET http://localhost:8080/simple-greet ``` ```listing {"message":"Hello World!"} ``` -```bash +```shell curl -X GET http://localhost:8080/greet ``` ```listing {"message":"Hello World!"} ``` -```bash +```shell curl -X GET http://localhost:8080/greet/Joe ``` ```listing {"message":"Hello Joe!"} ``` -```bash +```shell curl -X PUT -H "Content-Type: application/json" -d '{"message" : "Hola"}' http://localhost:8080/greet/greeting curl -X GET http://localhost:8080/greet/Jose @@ -45,7 +45,7 @@ curl -X GET http://localhost:8080/greet/Jose ``` ## Try metrics -```bash +```shell # Prometheus Format curl -s -X GET http://localhost:8080/metrics/application ``` @@ -63,7 +63,7 @@ application_httpStatus_total{range="5xx"} 0 ``` # JSON Format -```bash +```shell curl -H "Accept: application/json" -X GET http://localhost:8080/metrics ``` ```json diff --git a/examples/microprofile/idcs/README.md b/examples/microprofile/idcs/README.md index 5277d382..436459a5 100644 --- a/examples/microprofile/idcs/README.md +++ b/examples/microprofile/idcs/README.md @@ -39,7 +39,7 @@ Edit application.yaml based on your IDCS Configuration ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-microprofile-security-idcs.jar ``` diff --git a/examples/microprofile/lra/README.md b/examples/microprofile/lra/README.md index dbcf3e61..8d06ef3e 100644 --- a/examples/microprofile/lra/README.md +++ b/examples/microprofile/lra/README.md @@ -2,7 +2,7 @@ ## Build and run -```bash +```shell mvn install && java -jar ./target/helidon-examples-microprofile-lra.jar ``` @@ -22,7 +22,7 @@ docker run --rm --name lra-coordinator --network="host" helidon/lra-coordinator ### Test LRA resource Then call for completed transaction: -```bash +```shell curl -X PUT -d 'lra rocks' http://localhost:7001/example/start-example ``` And observe processing success in the output followed by complete called by LRA coordinator: @@ -32,7 +32,7 @@ LRA id: f120a842-88da-429b-82d9-7274ee9ce8f6 completed 🎉 ``` For compensated transaction: -```bash +```shell curl -X PUT -d BOOM http://localhost:7001/example/start-example ``` Observe exception in the output followed by compensation called by LRA coordinator: @@ -44,6 +44,6 @@ LRA id: 3629421b-b2a4-4fc4-a2f0-941cbf3fa8ad compensated 🚒 ``` Or compensated transaction timeout: -```bash +```shell curl -X PUT -d TIMEOUT http://localhost:7001/example/start-example ``` \ No newline at end of file diff --git a/examples/microprofile/messaging-sse/README.md b/examples/microprofile/messaging-sse/README.md index 4c785716..11f1719b 100644 --- a/examples/microprofile/messaging-sse/README.md +++ b/examples/microprofile/messaging-sse/README.md @@ -7,7 +7,7 @@ ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-microprofile-messaging-sse.jar ``` diff --git a/examples/microprofile/multiport/README.md b/examples/microprofile/multiport/README.md index 47104b8c..f1b65d83 100644 --- a/examples/microprofile/multiport/README.md +++ b/examples/microprofile/multiport/README.md @@ -21,7 +21,7 @@ using @RoutingName. ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-microprofile-multiport.jar ``` diff --git a/examples/microprofile/oidc/README.md b/examples/microprofile/oidc/README.md index 67d5ca0a..9ec67d9e 100644 --- a/examples/microprofile/oidc/README.md +++ b/examples/microprofile/oidc/README.md @@ -21,7 +21,7 @@ in `application.yaml`. ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-microprofile-security-oidc-login.jar ``` diff --git a/examples/microprofile/openapi-basic/README.md b/examples/microprofile/openapi-basic/README.md index c3b4fd8b..98cc4e7a 100644 --- a/examples/microprofile/openapi-basic/README.md +++ b/examples/microprofile/openapi-basic/README.md @@ -5,7 +5,7 @@ Helidon MP QuickStart, enhanced with OpenAPI support. ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-microprofile-openapi-basic.jar ``` diff --git a/examples/microprofile/security/README.md b/examples/microprofile/security/README.md index 5ca38993..7636f44b 100644 --- a/examples/microprofile/security/README.md +++ b/examples/microprofile/security/README.md @@ -9,7 +9,7 @@ levels of security. ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-microprofile-mp1_1-security.jar ``` diff --git a/examples/microprofile/static-content/README.md b/examples/microprofile/static-content/README.md index 0209a968..083ac410 100644 --- a/examples/microprofile/static-content/README.md +++ b/examples/microprofile/static-content/README.md @@ -7,7 +7,7 @@ The configuration for the static content is in the ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-microprofile-mp1_1-static-content.jar ``` diff --git a/examples/microprofile/tls/README.md b/examples/microprofile/tls/README.md index 2d9a09a0..cd03a718 100644 --- a/examples/microprofile/tls/README.md +++ b/examples/microprofile/tls/README.md @@ -7,7 +7,7 @@ Note: This example uses self-signed server certificate! ### How to generate self-signed certificate (optional) In this example the certificate is bundled so no special certificate is required. Required tools: keytool -```bash +```shell keytool -genkeypair -keyalg RSA -keysize 2048 -alias server -dname "CN=localhost" -validity 21650 -keystore server.jks -storepass changeit -keypass changeit -deststoretype pkcs12 keytool -exportcert -keystore server.jks -storepass changeit -alias server -rfc -file server.cer keytool -certreq -keystore server.jks -alias server -keypass changeit -storepass changeit -keyalg rsa -file server.csr @@ -16,11 +16,11 @@ keytool -importkeystore -srckeystore server.jks -destkeystore server.p12 -srcsto ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-microprofile-tls.jar ``` ## Exercise the application -```bash +```shell curl -k -X GET https://localhost:8080 ``` diff --git a/examples/microprofile/websocket/README.md b/examples/microprofile/websocket/README.md index 64ae0882..73a536e9 100644 --- a/examples/microprofile/websocket/README.md +++ b/examples/microprofile/websocket/README.md @@ -5,7 +5,7 @@ that combines REST resources and WebSocket endpoints. ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-microprofile-websocket.jar ``` diff --git a/examples/openapi-tools/quickstart-mp/README.md b/examples/openapi-tools/quickstart-mp/README.md index eb7d40aa..1509d221 100644 --- a/examples/openapi-tools/quickstart-mp/README.md +++ b/examples/openapi-tools/quickstart-mp/README.md @@ -9,7 +9,7 @@ For generation of our projects we will use `openapi-generator-cli.jar` that can ## Build, prepare and run the Helidon MP server To generate Helidon MP server at first we create `mp-server` folder and then inside it we run the following command where `path-to-generator` is the directory where you downloaded the generator CLI JAR file and `path-to-openapi-doc` is the folder where `quickstart.yaml` is located: -```bash +```shell java -jar path-to-generator/openapi-generator-cli.jar \ generate \ -g java-helidon-server \ @@ -54,24 +54,24 @@ Let's change a little class `MessageServiceImpl` for our example : To run the application : -```bash +```shell mvn package java -jar target/openapi-java-server.jar ``` To check that server works as expected run the following `curl` commands : -``` +```shell curl -X GET http://localhost:8080/greet -{"message":"World","greeting":"Hello"} +#{"message":"World","greeting":"Hello"} curl -X GET http://localhost:8080/greet/Joe -{"message":"Joe","greeting":"Hello"} +#{"message":"Joe","greeting":"Hello"} curl -X PUT -H "Content-Type: application/json" -d '{"greeting" : "Hola", "message":"Lisa"}' http://localhost:8080/greet/greeting curl -X GET http://localhost:8080/greet -{"message":"Lisa","greeting":"Hola"} +#{"message":"Lisa","greeting":"Hola"} ``` ## Build, prepare and run the Helidon MP client @@ -79,7 +79,7 @@ curl -X GET http://localhost:8080/greet The second part of this example is generating MicroProfile Rest Client that will communicate with the server that we have just created. To generate Helidon MP client at first we create `mp-client` folder and then inside it we run the following command where `path-to-generator` is the directory where you downloaded the generator CLI JAR file and `path-to-openapi-doc` is the folder where `quickstart.yaml` is located: -```bash +```shell java -jar path-to-generator/openapi-generator-cli.jar \ generate \ -g java-helidon-client \ @@ -171,21 +171,21 @@ to To run the application : -```bash +```shell mvn package java -jar target/openapi-java-client.jar ``` To check that the client works as expected and process all the requests using our server run the following `curl` commands : -``` +```shell curl -X PUT -H "Content-Type: application/json" -d '{"greeting" : "Hi", "message":"Mike"}' http://localhost:8081/greet/greeting curl -X GET http://localhost:8081/greet -{"message":"Mike","greeting":"Hi"} +#{"message":"Mike","greeting":"Hi"} curl -X GET http://localhost:8081/greet/Joe -{"message":"Joe","greeting":"Hi"} +#{"message":"Joe","greeting":"Hi"} ``` ## Update applications diff --git a/examples/openapi-tools/quickstart-mp/mp-client/README.md b/examples/openapi-tools/quickstart-mp/mp-client/README.md index b5314a9b..45b317fb 100644 --- a/examples/openapi-tools/quickstart-mp/mp-client/README.md +++ b/examples/openapi-tools/quickstart-mp/mp-client/README.md @@ -2,7 +2,7 @@ ## Build and run -```bash +```shell mvn package java -jar target/openapi-mp-client.jar ``` diff --git a/examples/openapi-tools/quickstart-mp/mp-server/README.md b/examples/openapi-tools/quickstart-mp/mp-server/README.md index 06eb4753..5f156a2d 100644 --- a/examples/openapi-tools/quickstart-mp/mp-server/README.md +++ b/examples/openapi-tools/quickstart-mp/mp-server/README.md @@ -2,7 +2,7 @@ ## Build and run -```bash +```shell mvn package java -jar target/openapi-mp-server.jar ``` diff --git a/examples/openapi-tools/quickstart-se/README.md b/examples/openapi-tools/quickstart-se/README.md index 88300bfd..297f511c 100644 --- a/examples/openapi-tools/quickstart-se/README.md +++ b/examples/openapi-tools/quickstart-se/README.md @@ -9,7 +9,7 @@ For generation of our projects we will use `openapi-generator-cli.jar` that can ## Build, prepare and run the Helidon SE server To generate Helidon SE server at first we create `se-server` folder and then inside it we run the following command where `path-to-generator` is the directory where you downloaded the generator CLI JAR file and `path-to-openapi-doc` is the folder where `quickstart.yaml` is located: -```bash +```shell java -jar path-to-generator/openapi-generator-cli.jar \ generate \ -g java-helidon-server \ @@ -63,7 +63,7 @@ Let's change a little class `MessageServiceImpl` for our example : To run the application : -```bash +```shell mvn package java -jar target/openapi-java-server.jar ``` @@ -88,7 +88,7 @@ curl -X GET http://localhost:8080/greet The second part of this example is generating Helidon Webclient that will communicate with the server that we have just created. To generate Helidon SE Webclient at first we create `se-client` folder and then inside it we run the following command where `path-to-generator` is the directory where you downloaded the generator CLI JAR file and `path-to-openapi-doc` is the folder where `quickstart.yaml` is located: -```bash +```shell java -jar path-to-generator/openapi-generator-cli.jar \ generate \ -g java-helidon-client \ @@ -278,7 +278,7 @@ server: To run the application : -```bash +```shell mvn package java -jar target/openapi-java-client.jar ``` diff --git a/examples/openapi-tools/quickstart-se/se-server/README.md b/examples/openapi-tools/quickstart-se/se-server/README.md index 5cfcbd53..32e54da9 100644 --- a/examples/openapi-tools/quickstart-se/se-server/README.md +++ b/examples/openapi-tools/quickstart-se/se-server/README.md @@ -2,7 +2,7 @@ ## Build and run -```bash +```shell mvn package java -jar target/openapi-java-server.jar ``` diff --git a/examples/openapi/README.md b/examples/openapi/README.md index baf86178..12682caa 100644 --- a/examples/openapi/README.md +++ b/examples/openapi/README.md @@ -9,27 +9,27 @@ with the application. ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-openapi.jar ``` Try the endpoints: -``` +```shell curl -X GET http://localhost:8080/greet -{"message":"Hello World!"} +#{"message":"Hello World!"} curl -X GET http://localhost:8080/greet/Joe -{"message":"Hello 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!"} +#{"message":"Hola Jose!"} curl -X GET http://localhost:8080/openapi -[lengthy OpenAPI document] +#[lengthy OpenAPI document] ``` The output describes not only then endpoints in `GreetService` as described in diff --git a/examples/quickstarts/helidon-quickstart-mp/README.md b/examples/quickstarts/helidon-quickstart-mp/README.md index 6e456c63..48ef8a37 100644 --- a/examples/quickstarts/helidon-quickstart-mp/README.md +++ b/examples/quickstarts/helidon-quickstart-mp/README.md @@ -4,7 +4,7 @@ This example implements a simple Hello World REST service using MicroProfile. ## Build and run -```bash +```shell mvn package java -jar target/helidon-quickstart-mp.jar ``` diff --git a/examples/quickstarts/helidon-quickstart-se/README.md b/examples/quickstarts/helidon-quickstart-se/README.md index d6276727..a57f7c9b 100644 --- a/examples/quickstarts/helidon-quickstart-se/README.md +++ b/examples/quickstarts/helidon-quickstart-se/README.md @@ -4,7 +4,7 @@ This project implements a simple Hello World REST service using Helidon SE. ## Build and run -```bash +```shell mvn package java -jar target/helidon-quickstart-se.jar ``` diff --git a/examples/quickstarts/helidon-standalone-quickstart-mp/README.md b/examples/quickstarts/helidon-standalone-quickstart-mp/README.md index 252a95c4..fc872462 100644 --- a/examples/quickstarts/helidon-standalone-quickstart-mp/README.md +++ b/examples/quickstarts/helidon-standalone-quickstart-mp/README.md @@ -5,7 +5,7 @@ This example implements a simple Hello World REST service using MicroProfile ## Build and run -```bash +```shell mvn package java -jar target/helidon-standalone-quickstart-mp.jar ``` diff --git a/examples/quickstarts/helidon-standalone-quickstart-se/README.md b/examples/quickstarts/helidon-standalone-quickstart-se/README.md index 02d08260..fd296182 100644 --- a/examples/quickstarts/helidon-standalone-quickstart-se/README.md +++ b/examples/quickstarts/helidon-standalone-quickstart-se/README.md @@ -5,7 +5,7 @@ This project implements a simple Hello World REST service using Helidon SE with ## Build and run -```bash +```shell mvn package java -jar target/helidon-standalone-quickstart-se.jar ``` diff --git a/examples/security/attribute-based-access-control/README.md b/examples/security/attribute-based-access-control/README.md index 3c3bbdfb..e1bf22b8 100644 --- a/examples/security/attribute-based-access-control/README.md +++ b/examples/security/attribute-based-access-control/README.md @@ -4,7 +4,7 @@ JAX-RS (Jersey) example for attribute based access control. ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-security-abac.jar ``` diff --git a/examples/security/basic-auth-with-static-content/README.md b/examples/security/basic-auth-with-static-content/README.md index 3698cf43..d5812ea6 100644 --- a/examples/security/basic-auth-with-static-content/README.md +++ b/examples/security/basic-auth-with-static-content/README.md @@ -13,7 +13,7 @@ There are two examples with exactly the same behavior: ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-security-webserver-basic-uath.jar ``` @@ -21,7 +21,7 @@ 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 +```shell curl http://localhost:[PORT]/public curl -u "jill:changeit" http://localhost:[PORT]/noRoles curl -u "john:changeit" http://localhost:[PORT]/user diff --git a/examples/security/google-login/README.md b/examples/security/google-login/README.md index ec25bc7e..b4f5c355 100644 --- a/examples/security/google-login/README.md +++ b/examples/security/google-login/README.md @@ -19,7 +19,7 @@ Update the following files with your client id (it should support http://localho ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-security-google-login.jar ``` diff --git a/examples/security/idcs-login/README.md b/examples/security/idcs-login/README.md index 6f88cd17..5076dea8 100644 --- a/examples/security/idcs-login/README.md +++ b/examples/security/idcs-login/README.md @@ -41,7 +41,7 @@ Edit application.yaml for IdcsMain.java or OidcConfig variable definition for Id ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-security-oidc.jar ``` diff --git a/examples/security/jersey/README.md b/examples/security/jersey/README.md index e4282de0..3b0fdb64 100644 --- a/examples/security/jersey/README.md +++ b/examples/security/jersey/README.md @@ -12,13 +12,13 @@ There are three examples with exactly the same behavior ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-security-jersey.jar ``` Try the endpoints: -```bash +```shell curl http://localhost:8080/rest curl -v http://localhost:8080/rest/protected curl -u "jack:changeit" http://localhost:8080/rest/protected diff --git a/examples/security/nohttp-programmatic/README.md b/examples/security/nohttp-programmatic/README.md index 3adbea56..cc9017e6 100644 --- a/examples/security/nohttp-programmatic/README.md +++ b/examples/security/nohttp-programmatic/README.md @@ -4,7 +4,7 @@ Example of manually using the security APIs. ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-security-nohttp-programmatic.jar ``` diff --git a/examples/security/outbound-override/README.md b/examples/security/outbound-override/README.md index cdcaa62a..2a0446b2 100644 --- a/examples/security/outbound-override/README.md +++ b/examples/security/outbound-override/README.md @@ -6,13 +6,13 @@ sets the username and password. ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-security-outbound-override.jar ``` Try the endpoints: -```bash +```shell curl -u "jack:changeit" http://localhost:8080/propagate curl -u "jack:changeit" http://localhost:8080/override curl -u "jill:changeit" http://localhost:8080/propagate diff --git a/examples/security/webserver-digest-auth/README.md b/examples/security/webserver-digest-auth/README.md index cd97476e..b2cf4fd5 100644 --- a/examples/security/webserver-digest-auth/README.md +++ b/examples/security/webserver-digest-auth/README.md @@ -12,7 +12,7 @@ There are two examples with exactly the same behavior: ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-security-webserver-digest-auth.jar ``` @@ -20,7 +20,7 @@ java -jar target/helidon-examples-security-webserver-digest-auth.jar Try the application: The application starts on a random port, the following assumes it is `56551` -```bash +```shell curl http://localhost:[PORT]/public curl --digest -u "jill:changeit" http://localhost:[PORT]/noRoles curl --digest -u "john:changeit" http://localhost:[PORT]/user diff --git a/examples/security/webserver-signatures/README.md b/examples/security/webserver-signatures/README.md index 82b0058f..872e88bf 100644 --- a/examples/security/webserver-signatures/README.md +++ b/examples/security/webserver-signatures/README.md @@ -20,13 +20,13 @@ There are two examples with exactly the same behavior ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-security-webserver-signatures.jar ``` Try the endpoints: -```bash +```shell curl -u "jack:changeit" http://localhost:8080/service1 curl -u "jill:changeit" http://localhost:8080/service1-rsa curl -v -u "john:changeit" http://localhost:8080/service1 diff --git a/examples/todo-app/README.md b/examples/todo-app/README.md index 43294d76..bdaae1f0 100644 --- a/examples/todo-app/README.md +++ b/examples/todo-app/README.md @@ -5,14 +5,14 @@ implemented with Helidon MP and Helidon SE. ## Build -```bash +```shell mvn clean package docker build -t helidon-examples-todo-cassandra cassandra ``` ## Run -```bash +```shell docker run -d -p 9042:9042 --name helidon-examples-todo-cassandra helidon-examples-todo-cassandra docker run --name zipkin -d -p 9411:9411 openzipkin/zipkin java -jar backend/target/helidon-examples-todo-backend.jar & @@ -28,14 +28,14 @@ java -jar frontend/target/helidon-examples-todo-frontend.jar & If you want to run behind an HTTP proxy: -```bash +```shell export security_providers_0_google_dash_login_proxy_dash_host=proxy.acme.com export security_providers_0_google_dash_login_proxy_dash_port=80 ``` ## Stop -```bash +```shell kill %1 %2 docker rm -f zipkin helidon-examples-todo-cassandra ``` diff --git a/examples/translator-app/README.md b/examples/translator-app/README.md index 1a5f18af..49620733 100644 --- a/examples/translator-app/README.md +++ b/examples/translator-app/README.md @@ -6,18 +6,18 @@ This application demonstrates a pseudo application composed of two microservices ## Start Zipkin With Docker: -```bash +```shell docker run --name zipkin -d -p 9411:9411 openzipkin/zipkin ``` With Java 8+: -```bash +```shell curl -sSL https://zipkin.io/quickstart.sh | bash -s java -jar zipkin.jar ``` With Kubernetes: -```bash +```shell kubectl apply \ -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/ingress-nginx-3.15.2/deploy/static/provider/cloud/deploy.yaml \ -f ../k8s/zipkin.yaml @@ -26,7 +26,7 @@ kubectl apply \ ## Build and run With Docker: -```bash +```shell docker build -t helidon-examples-translator-backend backend/ docker build -t helidon-examples--translator-frontend frontend/ docker run --rm -d -p 9080:9080 \ @@ -41,14 +41,14 @@ docker run --rm -d -p 8080:8080 \ ``` With Java 8+: -```bash +```shell mvn package java -jar backend/target/helidon-examples-translator-backend.jar & java -jar frontend/target/helidon-examples-translator-frontend.jar ``` Try the endpoint: -```bash +```shell curl "http://localhost:8080?q=cloud&lang=czech" curl "http://localhost:8080?q=cloud&lang=french" curl "http://localhost:8080?q=cloud&lang=italian" @@ -58,14 +58,14 @@ Then check out the traces at http://localhost:9411. ## Run with Kubernetes (docker for desktop) -```bash +```shell docker build -t helidon-examples-translator-backend backend/ docker build -t helidon-examples-translator-frontend frontend/ kubectl apply -f backend/app.yaml -f frontend/app.yaml ``` Try the endpoint: -```bash +```shell curl "http://localhost/translator?q=cloud&lang=czech" curl "http://localhost/translator?q=cloud&lang=french" curl "http://localhost/translator?q=cloud&lang=italian" @@ -74,13 +74,13 @@ curl "http://localhost/translator?q=cloud&lang=italian" Then check out the traces at http://localhost/zipkin. Stop the docker containers: -```bash +```shell docker stop zipkin \ helidon-examples-translator-backend \ helidon-examples-translator-frontend ``` Delete the Kubernetes resources: -```bash +```shell kubectl delete -f backend/app.yaml -f frontend/app.yaml ``` \ No newline at end of file diff --git a/examples/webserver/basics/README.md b/examples/webserver/basics/README.md index 07997b01..c146d43f 100644 --- a/examples/webserver/basics/README.md +++ b/examples/webserver/basics/README.md @@ -8,13 +8,13 @@ methods. ## Build and run -```bash +```shell mvn package ``` To see the list of methods that are available run: -```bash +```shell java -DexampleName=help -jar target/helidon-examples-webserver-basics.jar ``` diff --git a/examples/webserver/comment-aas/README.md b/examples/webserver/comment-aas/README.md index 37f16a96..3918c032 100644 --- a/examples/webserver/comment-aas/README.md +++ b/examples/webserver/comment-aas/README.md @@ -5,14 +5,14 @@ This application allows users to add or read short comments related to a single ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-webserver-comment-aas.jar ``` Try the application: -```bash +```shell curl http://localhost:8080/comments/java -d "I use Helidon!" curl http://localhost:8080/comments/java -d "I use vertx" curl http://localhost:8080/comments/java -d "I use spring" diff --git a/examples/webserver/fault-tolerance/README.md b/examples/webserver/fault-tolerance/README.md index 213549b9..ffd1cff3 100644 --- a/examples/webserver/fault-tolerance/README.md +++ b/examples/webserver/fault-tolerance/README.md @@ -4,14 +4,14 @@ This application runs fault tolerance service on port 8079. ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-webserver-fault-tolerance.jar ``` The output will be like: -```bash +```shell [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.6-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] diff --git a/examples/webserver/jersey/README.md b/examples/webserver/jersey/README.md index 620d4195..c6d6bcea 100644 --- a/examples/webserver/jersey/README.md +++ b/examples/webserver/jersey/README.md @@ -7,12 +7,12 @@ and `GET` the `Hello World!` response by accessing `http://localhost:8080/jersey ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-webserver-jersey.jar ``` Make an HTTP request to application: -```bash +```shell curl http://localhost:8080/jersey/hello ``` diff --git a/examples/webserver/multiport/README.md b/examples/webserver/multiport/README.md index 0bec11e2..bb6e5a3c 100644 --- a/examples/webserver/multiport/README.md +++ b/examples/webserver/multiport/README.md @@ -20,7 +20,7 @@ Seperate routing is defined for each named socket in `Main.java` ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-webserver-multiport.jar ``` diff --git a/examples/webserver/mutual-tls/README.md b/examples/webserver/mutual-tls/README.md index 5c0efccb..e13809f0 100644 --- a/examples/webserver/mutual-tls/README.md +++ b/examples/webserver/mutual-tls/README.md @@ -27,7 +27,7 @@ to your browser and invoke the endpoint manually. ### Howto regenerate certificates (optional) In order to regenerate bundled certificates: client.p12 and server.p12 use bundled script with given parameters: -```bash +```shell ./automatic-store-generator.sh --name Helidon --type P12 --single true ``` and then copy generated certificates from ``out/client.p12`` and ``out/server.p12`` diff --git a/examples/webserver/opentracing/README.md b/examples/webserver/opentracing/README.md index f5ffcce5..71f761b9 100644 --- a/examples/webserver/opentracing/README.md +++ b/examples/webserver/opentracing/README.md @@ -3,12 +3,12 @@ ## Start Zipkin With Docker: -```bash +```shell docker run --name zipkin -d -p 9411:9411 openzipkin/zipkin ``` With Java 8+: -```bash +```shell curl -sSL https://zipkin.io/quickstart.sh | bash -s java -jar zipkin.jar ``` @@ -16,26 +16,26 @@ java -jar zipkin.jar ## Build and run With Docker: -```bash +```shell docker build -t helidon-webserver-opentracing-example . docker run --rm -d --link zipkin --name helidon-webserver-opentracing-example \ -p 8080:8080 helidon-webserver-opentracing-example:latest ``` With Java 8+: -```bash +```shell mvn package java -jar target/helidon-examples-webserver-opentracing.jar ``` Try the endpoint: -```bash +```shell curl http://localhost:8080/test ``` Then check out the traces at http://localhost:9411. Stop the docker containers: -```bash +```shell docker stop zipkin helidon-webserver-opentracing-example ``` diff --git a/examples/webserver/static-content/README.md b/examples/webserver/static-content/README.md index 6b4d1edf..cab3abc9 100644 --- a/examples/webserver/static-content/README.md +++ b/examples/webserver/static-content/README.md @@ -5,7 +5,7 @@ This application demonstrates use of the StaticContentSupport to serve static fi ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-webserver-static-content.jar ``` diff --git a/examples/webserver/streaming/README.md b/examples/webserver/streaming/README.md index a23e9cd3..9347ff66 100644 --- a/examples/webserver/streaming/README.md +++ b/examples/webserver/streaming/README.md @@ -7,13 +7,13 @@ to the size of the file being uploaded or downloaded. ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-webserver-streaming.jar ``` Upload a file and download it back with `curl`: -```bash +```shell curl --data-binary "@large-file.bin" http://localhost:8080/upload curl http://localhost:8080/download ``` diff --git a/examples/webserver/threadpool/README.md b/examples/webserver/threadpool/README.md index 09ef9185..f3e5dbac 100644 --- a/examples/webserver/threadpool/README.md +++ b/examples/webserver/threadpool/README.md @@ -29,7 +29,7 @@ threadpool. ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-webserver-threadpool.jar ``` @@ -47,17 +47,17 @@ See `logging.properties` for the logging configuration. Each request will return the name of the thread the created the response. For example: -``` +```shell $ curl -X GET http://localhost:8080/greet/Jane -{"message":"Hello Jane!","thread":"Thread[nioEventLoopGroup-3-2,10,main]"} +#{"message":"Hello Jane!","thread":"Thread[nioEventLoopGroup-3-2,10,main]"} ``` `nioEventLoopGroup-` indicates that this is a Netty worker thread. To exercise the application thread pool do this: -``` +```shell curl -X GET http://localhost:8080/greet/slowly/Jane -{"message":"Hello Jane!","thread":"Thread[my-thread-1,5,helidon-thread-pool-2]"} +#{"message":"Hello Jane!","thread":"Thread[my-thread-1,5,helidon-thread-pool-2]"} ``` You'll notice that the response takes ~3 seconds to return -- that's an artificial delay diff --git a/examples/webserver/tls/README.md b/examples/webserver/tls/README.md index 6840bd02..78338c43 100644 --- a/examples/webserver/tls/README.md +++ b/examples/webserver/tls/README.md @@ -4,14 +4,14 @@ This application starts a web server with TLS support on the port 8081. ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-webserver-tls.jar ``` The output will be like: -```bash +```shell [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.6-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 diff --git a/examples/webserver/tutorial/README.md b/examples/webserver/tutorial/README.md index 6966c171..3126ba34 100644 --- a/examples/webserver/tutorial/README.md +++ b/examples/webserver/tutorial/README.md @@ -4,13 +4,13 @@ This application demonstrates various WebServer use cases together and in its co ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-webserver-tutorial.jar ``` run -```bash +```shell curl -X POST http://localhost:8080/mgmt/shutdown ``` in order to stop the server \ No newline at end of file diff --git a/examples/webserver/websocket/README.md b/examples/webserver/websocket/README.md index bbf5c852..8d60c239 100644 --- a/examples/webserver/websocket/README.md +++ b/examples/webserver/websocket/README.md @@ -4,10 +4,10 @@ This application demonstrates use of websockets and REST. ## Build and run -```bash +```shell mvn package java -jar target/helidon-examples-webserver-websocket.jar ``` Open http://localhost:8080/web/index.html in your browser. -`` +