@@ -64,8 +64,16 @@ artists.json
6464include::finish/src/resources/artists.json[]
6565----
6666
67+ // Static guide instruction
68+ ifndef::cloud-hosted[]
6769You will implement an Angular client that consumes this JSON and displays its contents
6870at the `\http://localhost:9080/app` URL.
71+ endif::[]
72+
73+ // Cloud hosted guide instruction
74+ ifdef::cloud-hosted[]
75+ You will implement an Angular client that consumes this JSON and displays its contents.
76+ endif::[]
6977
7078To learn more about REST services and how you can write them, see
7179https://openliberty.io/guides/rest-intro.html[Creating a RESTful web service^].
@@ -80,7 +88,20 @@ include::{common-includes}/gitclone.adoc[]
8088[role='command']
8189include::{common-includes}/twyb-intro.adoc[]
8290
91+ // Static guide instruction
92+ ifndef::cloud-hosted[]
8393Then, point your browser to the web application root http://localhost:9080/app[http://localhost:9080/app^] to see the following output:
94+ endif::[]
95+
96+ // Cloud hosted guide instruction
97+ ifdef::cloud-hosted[]
98+ Select **Launch Application** from the menu of the IDE,
99+ type **9080** to specify the port number for the microservice, and click the **OK** button.
100+ You're redirected to a URL similar to **`https://accountname-9080.theiadocker-4.proxy.cognitiveclass.ai/app/`**,
101+ where **accountname** is your account name. You will see the following output:
102+ endif::[]
103+
104+
84105
85106[subs="quotes", role="no_copy"]
86107----
@@ -106,11 +127,31 @@ the artist JSON is available to you.
106127
107128Navigate to the `start` directory to begin.
108129
130+ // cloud-hosted guide instructions:
131+ ifdef::cloud-hosted[]
132+ ```
133+ cd /home/project/guide-rest-client-angular/start
134+ ```
135+ {: codeblock}
136+ endif::[]
137+
109138[role='command']
110139include::{common-includes}/devmode-lmp33-start.adoc[]
111140
141+ // Static guide instruction
142+ ifndef::cloud-hosted[]
112143You can find your artist JSON at the
113144http://localhost:9080/artists[http://localhost:9080/artists^] URL.
145+ endif::[]
146+
147+ // Cloud hosted guide instruction
148+ ifdef::cloud-hosted[]
149+ You can find your artist JSON by running the following command at a terminal:
150+ ```
151+ curl -s http://localhost:9080/artists | jq
152+ ```
153+ {: codeblock}
154+ endif::[]
114155
115156// =================================================================================================
116157// Project configuration
@@ -328,18 +369,41 @@ used to display each [hotspot=albumDiv]`album` by each artist.
328369== Building the front end
329370
330371The Open Liberty server is already started, and the REST service is running. In a new
331- command-line session, build the front end by running the following command:
372+ command-line session, build the front end by running the following command in the `start` directory :
332373
374+ // Static guide instruction
375+ ifndef::cloud-hosted[]
333376[role='command']
334377```
335378mvn generate-resources
336379```
380+ endif::[]
381+ // Cloud hosted guide instruction
382+ ifdef::cloud-hosted[]
383+ ```
384+ cd /home/project/guide-rest-client-angular/start
385+ mvn generate-resources
386+ ```
387+ {: codeblock}
388+ endif::[]
337389
390+ The build might take a few minutes to complete.
338391You can rebuild the front end at any time with the `generate-resources` Maven goal.
339392Any local changes to your TypeScript or HTML are picked up when you build the front end.
340393
394+ // Static guide instruction
395+ ifndef::cloud-hosted[]
341396Point your browser to the http://localhost:9080/app[http://localhost:9080/app^]
342397web application root to see the following output:
398+ endif::[]
399+
400+ // Cloud hosted guide instruction
401+ ifdef::cloud-hosted[]
402+ Select **Launch Application** from the menu of the IDE,
403+ type **9080** to specify the port number for the microservice, and click the **OK** button.
404+ You're redirected to a URL similar to **`https://accountname-9080.theiadocker-4.proxy.cognitiveclass.ai/app/`**,
405+ where **accountname** is your account name. You will see the following output:
406+ endif::[]
343407
344408[subs="quotes", role="no_copy"]
345409----
@@ -362,9 +426,18 @@ A web browser runs JavaScript, and the `curl` command doesn't.
362426No explicit code directly uses the consumed artist JSON, so you don't need to write
363427any test cases.
364428
429+ // Static guide instruction
430+ ifndef::cloud-hosted[]
365431Whenever you change and build your Angular implementation, the application root at
366432http://localhost:9080/app[http://localhost:9080/app^] reflects the changes
367433automatically.
434+ endif::[]
435+
436+ // Cloud hosted guide instruction
437+ ifdef::cloud-hosted[]
438+ Whenever you change and build your Angular implementation, the changes are automatically reflected
439+ at the URL for the launched application.
440+ endif::[]
368441
369442When you are done checking the application root, exit development mode by
370443pressing `CTRL+C` in the command-line session where you ran the server,
@@ -378,7 +451,6 @@ https://angular.io/guide/testing[official Angular page^].
378451
379452== Great work! You're done!
380453
381- You just accessed a simple RESTful web service and consumed its resources by using
382- Angular in Open Liberty.
454+ You just accessed a simple RESTful web service and consumed its resources by using Angular in Open Liberty.
383455
384456include::{common-includes}/attribution.adoc[subs="attributes"]
0 commit comments