File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
src/main/java/io/radanalytics/examples/vertx Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 11# vertx-sparkpi
2- A Java implementation of SparkPi using Vert.x 3
2+ A Java implementation of SparkPi using Vert.x 3
33
44This application is an example tutorial for the
55[ radanalytics.io] ( http://radanalytics.io ) community. It is intended to be
@@ -32,5 +32,8 @@ You should have access to an OpenShift cluster and be logged in with the
32321 . Visit the exposed URL with your browser or other HTTP tool, for example:
3333 ``` bash
3434 $ curl http://` oc get routes/vertx-sparkpi --template=' {{.spec.host}}' `
35- Pi is rouuuughly 3.1335
35+ Java Vert.x SparkPi server running. Add the ' sparkpi' route to this URL to invoke the app.
36+
37+ $ curl http://` oc get routes/vertx-sparkpi --template=' {{.spec.host}}' ` /sparkpi
38+ Pi is roughly 3.140480
3639 ```
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ public class SparkPiVerticle extends AbstractVerticle {
2424 private static final Logger log = Logger .getRootLogger ();
2525 private Properties prop = null ;
2626
27- // vertx-config has more exotic options using Futures
27+ // vertx-config has more exotic options using Futures
2828 // and AsyncResult handlers, but this is all we need
2929 private String loadJarProperty () {
3030 if (null ==prop ) {
@@ -65,6 +65,13 @@ public void run() {
6565 SparkPiProducer pi = new SparkPiProducer ();
6666
6767 router .route ("/" ).handler (routingContext -> {
68+ HttpServerResponse response = routingContext .response ();
69+ response
70+ .putHeader ("content-type" , "text/html" )
71+ .end ("Java Vert.x SparkPi server running. Add the 'sparkpi' route to this URL to invoke the app." );
72+ });
73+
74+ router .route ("/sparkpi" ).handler (routingContext -> {
6875 HttpServerResponse response = routingContext .response ();
6976 response
7077 .putHeader ("content-type" , "text/html" )
You can’t perform that action at this time.
0 commit comments