diff --git a/docs/tutorial/code/node-app/task.yaml b/docs/tutorial/code/node-app/task.yaml index 58da9cfa6..7ce2b4b99 100644 --- a/docs/tutorial/code/node-app/task.yaml +++ b/docs/tutorial/code/node-app/task.yaml @@ -38,6 +38,10 @@ execute: | # Wait for a bit for the app to come online retry -n 5 --wait 2 curl localhost:8000 + # [docs:curl-localhost] + curl http://localhost:8000 + # [docs:curl-localhost-end] + curl localhost:8000 | MATCH "Hello World from inside the rock" # [docs:stop-container] diff --git a/docs/tutorial/node-app.rst b/docs/tutorial/node-app.rst index 83c4131ab..fb1e78306 100644 --- a/docs/tutorial/node-app.rst +++ b/docs/tutorial/node-app.rst @@ -116,9 +116,22 @@ service: 2023-10-30T12:37:33.663Z [pebble] Service "app" starting: node server.js 2023-10-30T12:37:33.864Z [app] Running on http://0.0.0.0:8080 -Next, open your web browser and navigate to ``http://localhost:8000``. You -should see a blank page with a "Hello World from inside the rock!" message. -Success! +Next we'll verify that the Node.js app is up and running. If you're working on +a regular Ubuntu system, open your web browser and go to +``http://localhost:8000``. You should see a blank page with a +"Hello World from inside the rock!" message. Success! + +If, instead, you're working in a Multipass VM, you can +open another shell into the VM and access the app with curl: + +.. literalinclude:: code/node-app/task.yaml + :language: bash + :prepend: multipass shell rock-dev + :start-after: [docs:curl-localhost] + :end-before: [docs:curl-localhost-end] + :dedent: 2 + +This should also print "Hello World from inside the rock!" to the terminal. You can now stop the running container by either interrupting it with CTRL+C or by running the following in another terminal: